LoVisual/backend/gateway/Dockerfile
loki5512344 95186ad49c
fix(deploy): pin backend Dockerfiles' builder/runtime base to the same Debian release
accounts-service crash-looped in production: GLIBC_2.38 not found. The
builder stage used the floating rust:1-slim tag (now Debian trixie,
glibc 2.38+) while the runtime stage used debian:bookworm-slim (glibc
2.36) — a base mismatch. Pin both stages to trixie so the runtime glibc
is always at least as new as what the binary was linked against.

Claude-Session: https://claude.ai/code/session_01F1M1Jic1wTSn4igUENynmZ
2026-09-28 15:32:30 +02:00

19 lines
723 B
Docker

# Build context must be backend/ (the workspace root).
FROM rust:1-trixie AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
protobuf-compiler pkg-config libssl-dev ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY Cargo.toml Cargo.lock ./
COPY common ./common
COPY accounts-service ./accounts-service
COPY gateway ./gateway
COPY configs-service ./configs-service
RUN cargo build --release -p gateway
FROM debian:trixie-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libssl3 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /build/target/release/gateway /usr/local/bin/gateway
ENTRYPOINT ["/usr/local/bin/gateway"]