build: fail fast on stalled npm fetches in the image build
All checks were successful
/ checks (push) Successful in 37s
/ deploy (push) Successful in 10s

This commit is contained in:
nholtware 2026-11-05 11:18:53 -06:00
parent ec4b769be2
commit f0596d1fd3

View file

@ -2,7 +2,8 @@
FROM node:22 AS build
WORKDIR /app
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 tsconfig.json ./
COPY src ./src
RUN npm run build
@ -15,7 +16,7 @@ ENV NODE_ENV=production
ARG GIT_SHA=dev
ENV GIT_SHA=${GIT_SHA}
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
RUN npm ci --omit=dev --fetch-timeout=60000 --fetch-retries=5 --fetch-retry-mintimeout=2000 --no-audit --no-fund
COPY --from=build /app/dist ./dist
COPY migrations ./migrations
USER node