build: fail fast on stalled npm fetches in the image build

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nholtware 2026-11-05 02:36:31 -06:00
parent 9fd6fd1d26
commit 20b204da4d

View file

@ -2,7 +2,8 @@
FROM node:22.23.4-alpine AS build FROM node:22.23.4-alpine AS build
WORKDIR /app WORKDIR /app
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
RUN npm ci # Fail fast and retry on a stalled registry fetch (npm defaults can hang ~10 min).
RUN npm ci --fetch-timeout=60000 --fetch-retries=5 --fetch-retry-mintimeout=2000 --no-audit --no-fund
COPY . . COPY . .
ARG GIT_SHA=dev ARG GIT_SHA=dev
ENV VITE_GIT_SHA=${GIT_SHA} ENV VITE_GIT_SHA=${GIT_SHA}