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-pip
installation. - Changed the copying order to first include
package.json
andyarn.lock
for caching. - Simplified dependency installation by removing the redundant second install step.
- Introduced a new build stage
prod-deps
for installing only production dependencies. - Updated the
COPY
command to pullnode_modules
from theprod-deps
stage instead of thebuild
stage.
✨ Ask PR-Codex anything about this PR by commenting with
/codex {your question}