File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
charts/traceability-foss-frontend Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 1+ # Nonroot user is not needed beause we are using the "nginx-unprivileged" image
12# STAGE 1: Build
23FROM node:18-alpine as builder
34
@@ -20,8 +21,6 @@ HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=10s \
2021 CMD curl -fSs 127.0.0.1:8080/healthz || exit 1
2122
2223USER root
23- # Add a user with userid 8877 and name nonroot
24- RUN addgroup -S nonrootgroup && adduser -u 8877 -D -S nonroot -G nonrootgroup
2524
2625RUN rm /usr/share/nginx/html/index.html && rm /etc/nginx/conf.d/default.conf
2726
@@ -30,7 +29,7 @@ COPY --from=builder /ng-app/dist /usr/share/nginx/html
3029
3130# Give ownership to nginx user over dir with content
3231
33- RUN chown -R nonroot:nonrootgroup /usr/share/nginx/html/
32+ RUN chown -R nginx:nginx /usr/share/nginx/html/
3433USER nginx
3534
3635# Install Node.js from builder stage
@@ -46,8 +45,4 @@ COPY ./scripts/inject-dynamic-env.js /docker-entrypoint.d/
4645
4746# Validate NGINX configuration
4847RUN nginx -t
49-
50- USER root
51-
52- # Run Container as nonroot
53- USER nonroot
48+ USER 101
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ podSecurityContext: { }
5555securityContext :
5656 allowPrivilegeEscalation : false
5757 runAsNonRoot : true
58- runAsUser : 8877
58+ runAsUser : 101
5959 # runAsGroup: 3000
6060
6161service :
You can’t perform that action at this time.
0 commit comments