From 60c81ea7c1b36e4abc5b7a21035b8f3b38e35fe9 Mon Sep 17 00:00:00 2001 From: Eric Zheng Date: Mon, 12 Oct 2026 08:25:02 +1300 Subject: [PATCH 1/2] fix: repair Fly deploy Docker build broken by pnpm upgrade - pin pnpm@11.25.0 in the image; 'npm install -g pnpm' had floated to 12.x, which runs workspace preinstall scripts before dependencies are installed - run only-allow via 'npx --yes' so the guard does not need an existing node_modules - allow esbuild build scripts via allowBuilds (pnpm now errors on ignored builds) - use the committed pnpm-lock.yaml with --frozen-lockfile for reproducible images --- Dockerfile | 6 +++--- client/package.json | 2 +- package.json | 2 +- pnpm-workspace.yaml | 2 ++ server/package.json | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2fbdcd5..e8d823e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM node:20-alpine # Install nginx and pnpm RUN apk add --no-cache nginx -RUN npm install -g pnpm +RUN npm install -g pnpm@11.25.0 WORKDIR /app @@ -10,12 +10,12 @@ WORKDIR /app ENV NODE_ENV=production # Copy workspace files -COPY package.json pnpm-workspace.yaml ./ +COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./ COPY server/package.json ./server/ COPY client/package.json ./client/ # Install all dependencies -RUN pnpm install +RUN pnpm install --frozen-lockfile # Copy source COPY server/ ./server/ diff --git a/client/package.json b/client/package.json index 5de1cb4..cc71357 100644 --- a/client/package.json +++ b/client/package.json @@ -4,7 +4,7 @@ "version": "0.0.0", "type": "module", "scripts": { - "preinstall": "npx only-allow pnpm", + "preinstall": "npx --yes only-allow pnpm", "dev": "vite", "build": "tsc -b && vite build", "lint": "eslint .", diff --git a/package.json b/package.json index 45dc0d3..8bd36c6 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "scripts": { - "preinstall": "pnpm exec only-allow pnpm", + "preinstall": "npx --yes only-allow pnpm", "dev": "concurrently --names \"SERVER,CLIENT\" -c \"blue,red\" \"pnpm --filter server dev\" \"pnpm --filter client dev\"", "build": "pnpm --filter server build && pnpm --filter client build", "start": "node server/dist/server.js", diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index d9b3560..af130b7 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,3 +3,5 @@ packages: - "client" onlyBuiltDependencies: - esbuild +allowBuilds: + esbuild: true diff --git a/server/package.json b/server/package.json index 915e36b..3dec003 100644 --- a/server/package.json +++ b/server/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "preinstall": "npx only-allow pnpm", + "preinstall": "npx --yes only-allow pnpm", "dev": "tsx watch server.ts", "build": "tsc", "start": "node dist/server.js", From 725fbeae463d32e3a3aaa9bd29c510c4d2903df6 Mon Sep 17 00:00:00 2001 From: Eric Zheng Date: Mon, 12 Oct 2026 08:40:55 +1300 Subject: [PATCH 2/2] fix: use Node 22 for pnpm 11 compatibility --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e8d823e..3c9916e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-alpine +FROM node:22-alpine # Install nginx and pnpm RUN apk add --no-cache nginx