cb3a90be35
Dependencies now ship edition 2024, which Cargo 1.83 refuses to parse: feature `edition2024` is required ... not stabilized in this version of Cargo (1.83.0) The pin lived in two places and both had to move, or the daemon image would have failed the same way the CI job did.
34 lines
990 B
Docker
34 lines
990 B
Docker
FROM rust:1.97-bookworm AS build
|
|
|
|
# Install protoc
|
|
RUN apt-get update && apt-get install -y protobuf-compiler && rm -rf /var/lib/apt/lists/*
|
|
|
|
# build.rs compiles ../../packages/proto/daemon.proto, so the workspace layout
|
|
# has to be preserved inside the build context.
|
|
WORKDIR /build
|
|
COPY packages/proto ./packages/proto
|
|
COPY apps/daemon ./apps/daemon
|
|
|
|
WORKDIR /build/apps/daemon
|
|
RUN cargo build --release
|
|
|
|
# --- Production ---
|
|
FROM debian:bookworm-slim AS production
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
libssl3 \
|
|
mariadb-client \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY --from=build /build/apps/daemon/target/release/gamepanel-daemon /app/gamepanel-daemon
|
|
|
|
# Data directories
|
|
RUN mkdir -p /var/lib/gamepanel/servers /var/lib/gamepanel/backups /etc/gamepanel
|
|
|
|
EXPOSE 50051
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s CMD /app/gamepanel-daemon --health-check || exit 1
|
|
|
|
CMD ["/app/gamepanel-daemon"]
|