dockerfile and sqlx queries data
Some checks failed
Rust / Test (push) Has been cancelled
Rust / Rustfmt (push) Has been cancelled
Rust / Clippy (push) Has been cancelled
Rust / Code coverage (push) Has been cancelled

This commit is contained in:
Alphonse Paix
2025-09-28 04:29:52 +02:00
parent 2de3f8dcf7
commit b629a8e2fb
6 changed files with 110 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
FROM lukemathwalker/cargo-chef:latest-rust-1.89.0 AS chef
WORKDIR /app
RUN apt update && apt install -y nodejs npm && rm -rf /var/lib/apt/lists/*
FROM chef AS planner
COPY . .
@@ -7,12 +8,11 @@ RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN apt update -y \
&& apt install -y --no-install-recommends clang mold
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
ENV SQLX_OFFLINE=true
RUN cargo build --release --bin zero2prod
RUN npm install && npm run build-css
FROM debian:bookworm-slim AS runtime
WORKDIR /app
@@ -22,6 +22,7 @@ RUN apt update -y \
&& apt clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/zero2prod zero2prod
COPY assets assets
COPY configuration configuration
ENV APP_ENVIRONMENT=production
ENTRYPOINT [ "./zero2prod" ]