Uh oh!
There was an error while loading. Please reload this page.
feat(deployments): split project dependencies and code into separate layers - #4551
Conversation
…ayers The final image stage copied all of /app in one layer, so node_modules was re-pushed and re-pulled on every deploy even when dependencies were unchanged. Copy node_modules as its own layer and the bundled code (via a stage that strips node_modules) separately, so unchanged dependencies produce an identical blob that registries and workers already have.
Create node_modules after post-install commands so a command that prunes it can't fail the final-stage copy, keep the original install instruction so existing layer caches still hit, and make the code stage's node_modules removal work as a non-root user when a directory is read-only.
🦋 Changeset detectedLatest commit: b3f9604 The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughNode and Bun Containerfiles now create separate dependency and application-code layers. The build stage retains 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… in the code stage chmod -R u+w itself fails on a directory without owner execute; u+rwX grants traversal as it recurses. Also trim generated-Containerfile comments to the non-obvious constraints.
@trigger.dev/buildtrigger.dev@trigger.dev/core@trigger.dev/python@trigger.dev/react-hooks@trigger.dev/redis-worker@trigger.dev/rsc@trigger.dev/schema-to-json@trigger.dev/sdkcommit: |
Uh oh!
There was an error while loading. Please reload this page.
Deploy images previously shipped node_modules and the bundled task code in a single layer, so every deploy re-pushed and re-pulled the full dependency tree even when nothing in it changed. The generated Containerfile now copies
/app/node_modulesas its own layer and the app files separately. With unchanged dependencies the dependency layer is identical across deploys, so registries and workers already have it and only the code layer moves.