Docker file dependency + non-root checking
This commit is contained in:
@@ -27,11 +27,14 @@ WORKDIR /app/policy-manager
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server
|
||||
|
||||
# ---- Runtime Stage ----
|
||||
FROM gcr.io/distroless/base-debian12
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/policy-manager/server .
|
||||
|
||||
RUN groupadd -r nonroot && useradd -r -g nonroot nonroot && chown -R nonroot:nonroot /app
|
||||
|
||||
|
||||
EXPOSE 8080
|
||||
USER nonroot:nonroot
|
||||
ENTRYPOINT ["/app/server"]
|
||||
Reference in New Issue
Block a user