cbax_dev/Containerfile

22 lines
470 B
Text
Raw Normal View History

2024-01-23 02:02:56 +00:00
FROM lukemathwalker/cargo-chef:latest-rust-alpine as chef
WORKDIR /app
FROM chef AS planner
COPY ./Cargo.toml ./Cargo.lock ./
COPY ./src ./src
COPY ./templates ./templates
RUN cargo chef prepare
FROM chef AS builder
COPY --from=planner /app/recipe.json .
RUN cargo chef cook --release
COPY . .
RUN cargo build --release
RUN mv ./target/release/cbax_dev ./app
FROM scratch AS runtime
WORKDIR /app
COPY --from=builder /app/app ./app
EXPOSE 7654
ENTRYPOINT ["/app/app"]