Repository navigation
fix(docker): ship the realtime and migrations images with runtime dependencies only - #9983
Merged
Merged
Conversation
…endencies only Bun's --omit=dev skips the root's devDependencies but still installs every workspace member, each member's devDependencies, and the optional peers the lockfile can satisfy. Both images therefore carried drizzle-kit (with its bundled esbuild binaries), vitest, vite and tsx, and the esbuild Go binaries account for nearly all of their HIGH/CRITICAL scanner findings. scripts/prune-production-workspace.ts narrows a turbo prune to the members the target reaches through dependencies, optionalDependencies or a tsconfig extends, and strips devDependencies from the root and the kept members. The migrations image gains a dev stage that keeps drizzle-kit for the dev environment's db:push; its final stage, which every other environment builds, runs db:migrate with runtime dependencies only.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryRemoves development dependencies from the realtime and default migrations images.
|
This branch was successfully deployed
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
--omit=devskips the root's devDependencies but still installs every workspace member, each member's devDependencies, and any optional peers the lockfile can satisfy. So the realtime and migrations images shipped drizzle-kit (with its bundled esbuild binaries), vitest, vite and tsx. The esbuild Go binaries accounted for almost every HIGH/CRITICAL scanner finding in both images.scripts/prune-production-workspace.tsnarrows aturbo prune --dockeroutput to the workspace members the target actually reaches throughdependencies,optionalDependencies, or atsconfig.jsonextends(Bun reads tsconfig at runtime). It drops every other member, such as@sim/testing, and strips devDependencies from the root and the kept members. The root's devDependencies have to go too: otherwise Bun links the locked vitest to satisfy better-auth's optional peer.turbo prunelike realtime, which replaces the hand-maintained manifest list.db:migratewith runtime dependencies only.devstage keeps drizzle-kit for the dev environment'sdb:push --force.image-devbuilds that stage through a newtargetinput on the image action.--frozen-lockfile, as the migrations image already did. Bun keeps every locked resolution, and full-repository CI owns frozen-lockfile validation. I checked every installed third-party package against the repo lockfile: realtime 118/118 and migrations 6/6 are at a locked version.Type of Change
Testing
Built all three images locally (arm64):
node_modulesdevstageNeither production image contains drizzle-kit, @esbuild-kit, esbuild, tsx, vite, vitest, typescript or
@sim/testing.trivy HIGH/CRITICAL findings:
Ran
bun run db:migratefrom the new migrations image against a scratch pgvector pg17 database: it completes.Booted the new realtime image against scratch Postgres and Redis:
/healthreturns 200 and the socket.io polling handshake succeeds.biome on the new script.
Checklist
test-auditauthoring gate)