engine
engine copied to clipboard
Refactor Dockerfile to cache node_modules
PR-Codex overview
This PR focuses on optimizing the Docker build process for a Node.js application by restructuring the installation of dependencies and separating the production dependencies into a distinct stage.
Detailed summary
- Added
python3-pipinstallation. - Changed the copying order to first include
package.jsonandyarn.lockfor caching. - Simplified dependency installation by removing the redundant second install step.
- Introduced a new build stage
prod-depsfor installing only production dependencies. - Updated the
COPYcommand to pullnode_modulesfrom theprod-depsstage instead of thebuildstage.
✨ Ask PR-Codex anything about this PR by commenting with
/codex {your question}
we want to copy code after we run yarn install. That's how we get benefits from the layer cache. I'll investigate the build errors @jakeloo
This PR is stale because it has been open for 7 days with no activity. Remove stale label or comment or this PR will be closed in 3 days.