pnpm uses a symlink-based virtual store (.pnpm/) that breaks when copied between Docker stages — Node can't resolve modules from the copied tree, causing 'Cannot find module express' at startup. Replace the broken COPY with a proper pnpm install --prod in the runtime stage. Layer caching still applies: manifests + lockfile are copied before source so the install layer is only rebuilt when deps change. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4.0 KiB
4.0 KiB