# Build stage runs on the host platform to avoid QEMU SIGILL issues with Node.js 24 on arm64 FROM --platform=$BUILDPLATFORM node:24-alpine AS builder RUN apk add --update --no-cache make gcc g++ git curl openssl WORKDIR /usr/src/app COPY . ./ # Build backend code RUN npm ci && \ npm run build && \ npm ci --omit=dev && \ npm cache clean --force && \ mv ./edge-override.json ./config-override.json # Final stage uses the target platform's Node.js runtime FROM node:24-alpine RUN apk add --update --no-cache git curl openssl openssh WORKDIR /usr/src/app COPY --from=builder /usr/src/app . # This quick hack invalidates the cache. ADD https://www.google.com /time.now ENV NODE_ENV production ENV PORT 3000 EXPOSE 3000 CMD ["node" , "./built/server.js"]