change final image to use debian base

This commit is contained in:
Adithya 2024-01-05 18:28:08 +05:30
parent fa59e20dcf
commit 55d34f3650
Signed by: adtya
GPG key ID: 48FC9915FFD326D0

View file

@ -1,10 +1,19 @@
FROM nixos/nix:latest FROM nixos/nix:latest AS builder
WORKDIR /app WORKDIR /build
COPY . . COPY . .
RUN nix \ RUN nix \
--extra-experimental-features "nix-command flakes" \ --extra-experimental-features "nix-command flakes" \
build .#app build .#app
CMD [ "/app/result/bin/app" ] RUN mkdir -p /tmp/nix-store-closure
RUN cp -ra $(nix-store -qR result/) /tmp/nix-store-closure
FROM debian:stable-slim
WORKDIR /app
COPY --from=builder /tmp/nix-store-closure /nix/store
COPY --from=builder /build/result /app
CMD [ "/app/bin/app" ]