diff --git a/Dockerfile b/Dockerfile index 216b581..3847680 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,17 @@ RUN apk add --no-cache libc6-compat WORKDIR /app COPY package.json package-lock.json* ./ -RUN npm ci --registry http://171.22.25.73:8081/repository/npm-group/ +# The Nexus npm proxy intermittently returns 500s / corrupted tarballs while it +# back-fills its cache from upstream. Retry the whole install a few times — each +# pass re-requests only what's still missing, so successive runs converge once +# Nexus has cached every package. Bump npm's own retry budget too. +RUN for i in 1 2 3 4 5; do \ + npm ci --registry http://171.22.25.73:8081/repository/npm-group/ \ + --fetch-retries=5 --fetch-retry-factor=2 \ + --fetch-retry-mintimeout=20000 --fetch-retry-maxtimeout=120000 && exit 0; \ + echo "npm ci attempt $i failed; retrying in 10s..."; sleep 10; \ + done; \ + echo "npm ci failed after 5 attempts" && exit 1 # ── Stage 2: build ─────────────────────────────────────────────────────────── FROM node:20-alpine AS builder