build(docker): use scratch instead of rust image for runner layer

This commit is contained in:
Erica Marigold 2025-08-25 17:44:07 +01:00
parent b9fe0f42ec
commit db460ca871
Signed by: DevComp
SSH key fingerprint: SHA256:jD3oMT4WL3WHPJQbrjC3l5feNCnkv7ndW8nYaHX5wFw

View file

@ -13,7 +13,7 @@ COPY --from=install /temp/dev/vendor /temp/dev/.cargo .
COPY . . COPY . .
RUN cargo build --release --no-default-features --features $CARGO_FEATURES RUN cargo build --release --no-default-features --features $CARGO_FEATURES
FROM base AS runner FROM scratch AS runner
USER runner USER runner
EXPOSE 80/tcp 22/tcp EXPOSE 80/tcp 22/tcp
COPY --from=builder /usr/src/app/target/release/ssh-portfolio /usr/local/bin/ssh-portfolio COPY --from=builder /usr/src/app/target/release/ssh-portfolio /usr/local/bin/ssh-portfolio