29 lines
1.3 KiB
Docker
29 lines
1.3 KiB
Docker
FROM node:22-bookworm-slim AS web-build
|
|
WORKDIR /app/apps/overlay
|
|
COPY apps/overlay/package.json apps/overlay/package-lock.json ./
|
|
RUN npm ci
|
|
COPY apps/overlay ./
|
|
RUN npm run build
|
|
|
|
FROM rust:1.97-bookworm AS rust-build
|
|
WORKDIR /app
|
|
COPY apps/server-rust/Cargo.toml apps/server-rust/Cargo.lock ./apps/server-rust/
|
|
# `libilibili` is a sibling checkout in local development. Compose exposes it
|
|
# as a named build context so the image always compiles the same local source
|
|
# without copying a second, drifting crate into this repository.
|
|
COPY --from=libilibili . /libilibili
|
|
COPY apps/server-rust/src ./apps/server-rust/src
|
|
COPY apps/server-rust/migrations ./apps/server-rust/migrations
|
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|
--mount=type=cache,target=/app/target-cache \
|
|
CARGO_TARGET_DIR=/app/target-cache cargo build --manifest-path apps/server-rust/Cargo.toml --release && \
|
|
cp /app/target-cache/release/lxc-stream-server /app/lxc-stream-server
|
|
|
|
FROM debian:bookworm-slim
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
|
|
WORKDIR /app
|
|
COPY --from=rust-build /app/lxc-stream-server /app/lxc-stream-server
|
|
COPY --from=web-build /app/apps/overlay/dist /app/web
|
|
EXPOSE 9719
|
|
CMD ["/app/lxc-stream-server", "--config", "/app/config.toml"]
|