Use pnpm deploy to flatten each package's runtime subset into /deploy, then copy ONLY that into the runtime stage. Catalog + workspace:* specifiers previously forced full-workspace resolution into every image's node_modules — unnecessary for either runtime. Results (arm64, same smoke tests pass): - broker: 3.26GB → 341MB (-90%, drops all devDeps incl. drizzle-kit) - migrate: 3.27GB → 653MB (-80%, keeps drizzle-kit which IS runtime) Broker /health confirms GIT_SHA build-arg still propagates (gitSha: "30bc24f" in smoke test). Migrate still reads drizzle.config.ts and attempts the connection correctly. --legacy flag needed because pnpm 10 defaults to inject-workspace- packages mode which the monorepo doesn't opt into; legacy is safe here. --ignore-scripts on deploy skips the root postinstall (sherif lint:ws) which has nothing to do with runtime. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.5 KiB
1.5 KiB