Fix API crash: reorder Dockerfile to copy dist before pnpm install #45
Reference in New Issue
Block a user
Delete Branch "fix/dockerfile-layer-order"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
pnpm install --frozen-lockfile --prodexportsfields but didn't address the layer ordering issueProblem
API pods crash with
ERR_UNKNOWN_FILE_EXTENSION: ".ts"becausepnpm install --prodcreates workspace symlinks (node_modules/@groombook/db→packages/db/) before thedist/output exists. Node.js then falls back to resolving.tssource files which can't be executed without a transpiler.Fix
Copy the compiled
dist/directories and updatedpackage.jsonfiles from the builder stage first, then runpnpm install --prod. This ensures workspace symlinks point to directories that already contain the compiled JS output.Test plan
ERR_UNKNOWN_FILE_EXTENSIONcrash🤖 Generated with Claude Code