From 6b9ff466a1df052049fa429f4671557cbb4cb556 Mon Sep 17 00:00:00 2001 From: Darrell Date: Tue, 3 Dec 2024 10:27:18 +0900 Subject: [PATCH] separate into build and runtime stage --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Dockerfile b/Dockerfile index 8d30aefa..37e1ef29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,5 +34,14 @@ RUN /bin/bash -c "source /root/.nix-profile/etc/profile.d/nix.sh && \ cd /usr/src/app && \ /root/.nix-profile/bin/nix develop --extra-experimental-features nix-command --extra-experimental-features flakes --command cargo build --release --bin cdk-mintd" +# Create a runtime stage +FROM debian:bullseye-slim + +# Set the working directory +WORKDIR /usr/src/app + +# Copy the built application from the build stage +COPY --from=builder /usr/src/app/target/release/cdk-mintd /usr/src/app/target/release/cdk-mintd + # Set the entry point for the container CMD ["/usr/src/app/target/release/cdk-mintd"] \ No newline at end of file