add deployment configuration

This commit is contained in:
insects 2025-02-06 15:55:53 +01:00
parent 523d965c09
commit 56a0cc8838
5 changed files with 66 additions and 14 deletions

21
Dockerfile Normal file
View file

@ -0,0 +1,21 @@
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
WORKDIR /app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release --bin beacon
# We do not need the Rust toolchain to run the binary!
FROM debian:bookworm-slim AS runtime
WORKDIR /app
COPY --from=builder /app/target/release/beacon /app
COPY --from=builder /app/static /app/static
ENTRYPOINT ["/app/beacon"]