Worker: Dockerfile for produksjon (multi-stage Rust build)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
42cf812c64
commit
a6bc256ef1
1 changed files with 14 additions and 0 deletions
14
worker/Dockerfile
Normal file
14
worker/Dockerfile
Normal 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"]
|
||||||
Loading…
Add table
Reference in a new issue