Worker: Dockerfile for produksjon (multi-stage Rust build)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
vegard 2026-03-16 09:47:44 +01:00
parent 42cf812c64
commit a6bc256ef1

14
worker/Dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM rust:1.87-bookworm AS build
WORKDIR /app
COPY Cargo.toml Cargo.lock* ./
# Dummy main for dependency caching
RUN mkdir src && echo "fn main() {}" > src/main.rs
RUN cargo build --release 2>/dev/null || true
# Real source
COPY src ./src
RUN touch src/main.rs && cargo build --release
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=build /app/target/release/sidelinja-worker /usr/local/bin/
ENTRYPOINT ["sidelinja-worker"]