[BUG] [DOCKER][SECURITY] Refactor `website3.0/Dockerfile` for production-grade standalone builds and non-root execution
Description
The current website3.0/Dockerfile has multiple production and security issues:
Identified Problems
- Container runs as root
- Uses npm install instead of deterministic npm ci
- Copies entire node_modules into runtime image
- Missing Next.js output: "standalone" optimization
- Final image size becomes unnecessarily large (>1GB possible)
Risks
- Increased attack surface
- Slower CI/CD pipelines
- Higher deployment costs
- Non-reproducible builds
- Elevated privilege risk during container breakout
Proposed Improvements
- Security: Create and switch to non-root user:
-
USER node - Build Optimization: Enable standalone output in next.config.mjs:
-
output: "standalone" - Dependency Reliability
- Replace:
-
npm install- with: -npm ci - Runtime Optimization: Copy only standalone artifacts instead of full
node_modules.
Screenshots
No response
Any additional information?
Acceptance Criteria
- Container runs as non-root user
- Docker image size significantly reduced
- npm ci used in build stage
- Standalone Next.js build implemented
- Multi-stage build optimized for production
What browser are you seeing the problem on?
No response
Checklist
- [x] I have checked the existing issues
- [x] I have read the Contributing Guidelines
- [x] I am willing to work on this issue (optional)
GSSoC Participation
- [x] I am a GSSoC'26 contributor
Hello Harshit-Maurya838, Thanks for opening an issue in HelpOps-Hub! 🚀
-
Please make sure to follow our Contributing Guidelines.
-
Hope you star our Repo.
-
Join our official Discord server, where we can collaborate and discuss how to make HelpOps-Hub even better and more professional.
-
Don’t forget to follow us on LinkedIn!
@mdazfar2 Can you please assign this issue. I want to work under GSSoC'26
Hey! I'd love to take this on. I have good experience with Docker and security hardening — multi-stage builds, non-root execution, and npm ci are all patterns I've used before. Could you assign me to this issue?
Hi maintainers, I’d like to work on this Docker hardening task if it is available.
Plan:
- convert the app image to a multi-stage production Dockerfile
- use
npm cifor reproducible installs - run the final container as a non-root user
- keep Next standalone/output handling aligned with the repo setup
- add/update compose docs and verify build/run commands locally
I’ll wait for official assignment before opening any PR, per the contribution rules.
This issue has been automatically closed because it has been inactive for more than 30 days. If you believe this is still relevant, feel free to reopen it or create a new one. Thank you!