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
WORKDIR /app
FROM nixos/nix:latest AS builder
WORKDIR /build
COPY . .
RUN nix \
--extra-experimental-features "nix-command flakes" \
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" ]