Files
Ferrous-Solitaire/Dockerfile
T
funman300 505f0ebda3 fix(docker): remove unneeded openssl deps, verify sqlx offline cache path
All crypto uses pure-Rust backends: jsonwebtoken with rust_crypto feature,
sqlx with runtime-tokio-rustls, reqwest with rustls. Neither libssl-dev
(builder) nor libssl3 (runtime) are required. pkg-config is also removed
as no build.rs in the dep tree invokes it. EXPOSE updated to reflect the
SERVER_PORT env var with an 8080 fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 01:25:45 +00:00

29 lines
823 B
Docker

# Stage 1 — builder
# Compiles the solitaire_server binary in release mode.
# Requires a pre-generated .sqlx/ query cache (run `cargo sqlx prepare --workspace`
# before building the image so sqlx macros work without a live database).
FROM rust:slim AS builder
WORKDIR /app
COPY . .
# Tell sqlx to use the cached query metadata instead of a live database.
ENV SQLX_OFFLINE=true
RUN cargo build --release -p solitaire_server
# Stage 2 — runtime
# Minimal image that only contains the compiled binary and its runtime deps.
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install -y ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/solitaire_server /usr/local/bin/solitaire_server
EXPOSE ${SERVER_PORT:-8080}
ENTRYPOINT ["/usr/local/bin/solitaire_server"]