Issue #38 — ci: Optimize Docker Build
Description
Bloated Docker images increase deployment times, consume excessive bandwidth, and expand the attack surface. Optimizing the Dockerfile ensures a lean, secure, production-ready artifact that only contains necessary runtime code.
Requirements & Context
Architectural Goal: Create an immutable, highly optimized deployment artifact.
Implementation Expectations: Refactor the existing Dockerfile to use multi-stage builds. Strip out devDependencies from the final image. Execute the Node process as an unprivileged non-root user.
Acceptance Criteria
Out of Scope
- Multi-architecture builds (e.g., ARM64 + AMD64 configurations).
Suggested Execution
git checkout -b ci/docker-optimization
Suggested Commit Message
ci: optimize dockerfile for production sizes and security
Testing Notes
- Build the image locally and inspect its layers. Exec into the container and verify
whoami is not root.
References
Node.js Docker Best Practices.
Definition of Done
Issue #38 — ci: Optimize Docker Build
Description
Bloated Docker images increase deployment times, consume excessive bandwidth, and expand the attack surface. Optimizing the Dockerfile ensures a lean, secure, production-ready artifact that only contains necessary runtime code.
Requirements & Context
Architectural Goal: Create an immutable, highly optimized deployment artifact.
Implementation Expectations: Refactor the existing Dockerfile to use multi-stage builds. Strip out
devDependenciesfrom the final image. Execute the Node process as an unprivileged non-root user.Acceptance Criteria
Out of Scope
Suggested Execution
Suggested Commit Message
Testing Notes
whoamiis notroot.References
Node.js Docker Best Practices.
Definition of Done