Update Dockerfile

chore: grant ownership of `/app` directory to `nextjs` system account
This commit is contained in:
Jason Fraley 2026-05-18 17:12:53 -04:00 committed by GitHub
parent 8da636cf85
commit 64af53361a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,6 +52,9 @@ COPY --from=builder /app/public ./public
RUN mkdir .next RUN mkdir .next
RUN chown nextjs:nodejs .next RUN chown nextjs:nodejs .next
# Give total ownership of the application to the nextjs system account
RUN chown -R nextjs:nodejs /app/
# Automatically leverage output traces to reduce image size # Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing # https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./