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 <noreply@anthropic.com>
This commit is contained in:
+8
-2
@@ -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
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "siteforge",
|
||||
"private": true,
|
||||
"version": "1.1.12",
|
||||
"version": "1.1.13",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
Reference in New Issue
Block a user