diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 91103fe..a3826de 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,21 +1,22 @@ # Development stage FROM node:22-alpine AS development -RUN apk upgrade --no-cache \ - && npm install -g npm@latest +RUN apk upgrade --no-cache WORKDIR /app COPY package*.json ./ -RUN npm i +RUN npm ci COPY . . EXPOSE 3000 CMD ["npm", "run", "dev"] -# Build stage -FROM node:22-alpine AS build -RUN apk upgrade --no-cache \ - && npm install -g npm@latest +# Build stage — always on the native builder arch. +# Cross-compiling Node/npm under QEMU for linux/arm64 crashes with +# "qemu: uncaught target signal 4 (Illegal instruction)". Vite output is +# architecture-independent static files, so building on $BUILDPLATFORM is safe. +FROM --platform=$BUILDPLATFORM node:22-alpine AS build +RUN apk upgrade --no-cache WORKDIR /app COPY package*.json ./ -RUN npm i --include=dev +RUN npm ci --include=dev COPY . . RUN npm run build