From bdafac2908104e920d2e2d3a1932a3a8a2514953 Mon Sep 17 00:00:00 2001 From: nmemmert Date: Tue, 28 Jul 2026 10:53:29 -0400 Subject: [PATCH] Fix arm64 Docker build crash (QEMU illegal instruction); v1.1.13 Run npm ci on the native build platform using --platform=\$BUILDPLATFORM in a deps stage, then copy node_modules to the runtime image. Avoids running Node.js under QEMU emulation, which crashes with SIGILL on arm64 cross-builds. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 10 ++++++++-- package.json | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fb999e9..2a6283a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,10 @@ +# Install prod deps on the native builder platform to avoid QEMU npm crashes +# during cross-platform builds. All deps are pure-JS so this is safe. +FROM --platform=$BUILDPLATFORM node:22-alpine AS deps +WORKDIR /app +COPY package*.json ./ +RUN npm ci --omit=dev --legacy-peer-deps + FROM node:22-alpine AS runtime WORKDIR /app @@ -7,8 +14,7 @@ ENV PORT=4173 ARG COMMIT_SHA=unknown ENV COMMIT_SHA=${COMMIT_SHA} -COPY package*.json ./ -RUN npm ci --omit=dev --legacy-peer-deps +COPY --from=deps /app/node_modules ./node_modules COPY dist ./dist COPY server.js ./server.js diff --git a/package.json b/package.json index b942119..521487e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "siteforge", "private": true, - "version": "1.1.12", + "version": "1.1.13", "type": "module", "scripts": { "dev": "vite",