Docker file dependency + non-root checking

This commit is contained in:
2026-04-06 23:31:07 -04:00
parent 586dc12836
commit 40f7f4af5a

View File

@@ -27,11 +27,14 @@ WORKDIR /app/identity-manager
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server
# ---- Runtime Stage ---- # ---- Runtime Stage ----
FROM gcr.io/distroless/base-debian12 FROM debian:bookworm-slim
WORKDIR /app WORKDIR /app
COPY --from=builder /app/identity-manager/server . COPY --from=builder /app/identity-manager/server .
RUN groupadd -r nonroot && useradd -r -g nonroot nonroot && chown -R nonroot:nonroot /app
EXPOSE 8080 EXPOSE 8080
USER nonroot:nonroot USER nonroot:nonroot
ENTRYPOINT ["/app/server"] ENTRYPOINT ["/app/server"]