Skip to content

devops: optimize frontend Dockerfile for production#378

Open
AnnieIj wants to merge 3 commits into
dev-fatima-24:mainfrom
AnnieIj:devops/optimize-frontend-dockerfile
Open

devops: optimize frontend Dockerfile for production#378
AnnieIj wants to merge 3 commits into
dev-fatima-24:mainfrom
AnnieIj:devops/optimize-frontend-dockerfile

Conversation

@AnnieIj
Copy link
Copy Markdown

@AnnieIj AnnieIj commented May 27, 2026

Summary

Hardens the multi-stage frontend Dockerfile to run as a non-root user.

Changes

  • Add USER nginx so the container runs as the unprivileged nginx user
  • Fix /var/run/nginx.pid ownership so nginx can start under that user

Acceptance Criteria

  • Stage 1 builds the React app with Node.js
  • Stage 2 serves built assets with Nginx Alpine
  • Final image contains no Node.js or source files
  • Nginx config serves index.html for all routes (SPA routing)
  • Image builds successfully with docker build

Closes #318

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@AnnieIj Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DEVOPS] Optimize frontend Dockerfile for production

1 participant