Skip to content

Commit 746f2d7

Browse files
junzero741claude
andcommitted
fix(docker): remove nx prune step that overwrites esbuild package.json
The `pnpm nx prune backend` step was overwriting esbuild's generatePackageJson output with incorrect dependencies (build tools instead of runtime deps like express, cors, etc.), causing `npm install` to install the wrong packages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f373b77 commit 746f2d7

2 files changed

Lines changed: 1 addition & 14 deletions

File tree

apps/backend/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ COPY packages/shared/ ./packages/shared/
2121
RUN cd apps/backend && npx prisma generate
2222

2323
# Build backend (includes shared)
24+
# generatePackageJson in esbuild creates the correct runtime package.json
2425
RUN pnpm nx build backend
2526

26-
# Prune lockfile + copy workspace modules for production install
27-
RUN pnpm nx prune backend
28-
2927
# --- Production stage ---
3028
FROM node:22-slim
3129

apps/backend/start.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
#!/bin/sh
22
set -e
3-
4-
echo "=== DEBUG: package.json ==="
5-
cat package.json
6-
echo ""
7-
echo "=== DEBUG: node_modules contents ==="
8-
ls node_modules/ 2>/dev/null | head -30
9-
echo ""
10-
echo "=== DEBUG: express resolve test ==="
11-
node -e "try { console.log('express at:', require.resolve('express')); } catch(e) { console.log('FAIL:', e.message); }"
12-
echo "=== END DEBUG ==="
13-
143
echo "Running migrations..."
154
npx prisma migrate deploy
165
echo "Starting server..."

0 commit comments

Comments
 (0)