这是indexloc提供的服务,不要输入任何密码
Skip to content

chore(docker): Optimize Dockerfile Caching #8480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

faustoFF
Copy link

Summary

This PR improves Docker build performance by optimizing caching for npm install.

Changes

  • Separated COPY steps for all relevant package.json and package-lock.json files from workspaces.
  • Moved full source COPY after npm install.
  • This allows Docker to reuse cached layers if dependencies have not changed.

Benefits

  • Significantly faster rebuilds when source files change but dependencies remain the same.
  • Reduced image build times and more efficient CI/CD pipeline performance.
  • Aligns with Docker best practices for layer caching.

No functionality changes introduced.

@faustoFF faustoFF changed the title 🐳 chore(docker): optimize Docker npm dependency caching chore(docker): Optimize Dockerfile Caching Jul 15, 2025
@danny-avila
Copy link
Owner

ty I will test it out in the dev branch which will trigger a ci/cd workflow of the image build

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.

2 participants