From e4fa13353ed6fdd0a9b4f7ce0f8c2b76d7b908bf Mon Sep 17 00:00:00 2001 From: Gabi Date: Wed, 29 Mar 2023 03:07:16 -0300 Subject: [PATCH] cd: include review changes + add chef planner --- Dockerfile | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 12f0678..49a29e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,18 @@ -FROM rust:1.68.1 AS builder -RUN apt-get update && apt-get -y upgrade +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 +RUN cargo chef cook --release --recipe-path recipe.json COPY . . -RUN cargo build --release +RUN cargo build --release --bin blob-indexer + -FROM debian:buster-slim -COPY --from=builder ./target/release/blob-indexer ./target/release/blob-indexer -CMD ["/target/release/blob-indexer"] \ No newline at end of file +FROM debian:bullseye-slim AS runtime +WORKDIR app +COPY --from=builder /app/target/release/blob-indexer /usr/local/bin +ENTRYPOINT ["/usr/local/bin/blob-indexer"] \ No newline at end of file