ci: fix Docker builder-stage layer caching#159
Closed
jakebromberg wants to merge 1 commit intotask/reduce-ci-minutesfrom
Closed
ci: fix Docker builder-stage layer caching#159jakebromberg wants to merge 1 commit intotask/reduce-ci-minutesfrom
jakebromberg wants to merge 1 commit intotask/reduce-ci-minutesfrom
Conversation
Both Dockerfiles copied source code before npm install in the builder stage, invalidating the dependency cache on every code change. Restructure to copy package manifests first, run npm ci (deterministic), then copy source and build. This enables Docker layer caching for the npm ci step when only source code changes (the common case).
d0f409f to
f5d2f4c
Compare
This was referenced Feb 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dockerfile.backendandDockerfile.authto copy package manifests before source codenpm installwithnpm cifor deterministic, faster dependency resolutionpackage-lock.jsonto builder stage (was missing, causing non-deterministic installs)This enables Docker layer caching for the
npm cistep: when only source code changes (the common case), the dependency layer is reused instead of rebuilt.Estimated savings
~1-2 minutes when code changes but dependencies don't (most CI runs)
Test plan
npm cilayer when only source changed