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
|
FROM node:22-alpine AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -7,8 +14,7 @@ ENV PORT=4173
|
|||||||
ARG COMMIT_SHA=unknown
|
ARG COMMIT_SHA=unknown
|
||||||
ENV COMMIT_SHA=${COMMIT_SHA}
|
ENV COMMIT_SHA=${COMMIT_SHA}
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
RUN npm ci --omit=dev --legacy-peer-deps
|
|
||||||
|
|
||||||
COPY dist ./dist
|
COPY dist ./dist
|
||||||
COPY server.js ./server.js
|
COPY server.js ./server.js
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "siteforge",
|
"name": "siteforge",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.1.12",
|
"version": "1.1.13",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
Reference in New Issue
Block a user