From f0596d1fd3f6f317933e2a931f779236c46bf07a Mon Sep 17 00:00:00 2001 From: nholtware Date: Thu, 5 Nov 2026 11:18:53 -0600 Subject: [PATCH] build: fail fast on stalled npm fetches in the image build --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 021a348..c0057b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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