Skip to content

Conversation

segmentationfaulter
Copy link
Contributor

If we run npm ci after COPY . ., packages will need to be reinstalled upon every build since COPY . . directive invalidates the cache if any source file changes. Having RUN npm ci before COPY . . ensures that npm packages don't get reinstalled if packages.json doesn't change.

segmentationfaulter and others added 6 commits July 3, 2025 18:24
If we run `npm ci` after `COPY . .`, packages will need to be reinstalled upon every build since `COPY . .` directive invalidates the cache if any source file changes. Having `RUN npm ci` before `COPY . .` ensures that npm packages don't get reinstalled if `packages.json` doesn't change.
@aidankmcalister aidankmcalister merged commit a62b9f7 into prisma:main Aug 4, 2025
5 of 6 checks passed
jlecordier pushed a commit to jlecordier/docs-1 that referenced this pull request Sep 3, 2025
If we run `npm ci` after `COPY . .`, packages will need to be reinstalled upon every build since `COPY . .` directive invalidates the cache if any source file changes. Having `RUN npm ci` before `COPY . .` ensures that npm packages don't get reinstalled if `packages.json` doesn't change.

Co-authored-by: Aidan McAlister <[email protected]>
Co-authored-by: Ankur Datta <[email protected]>
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.

3 participants