diff --git a/Dockerfile b/Dockerfile index 45d29a2..6e4fe8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,13 +5,19 @@ WORKDIR /app # Install build tools + OpenSSL (required by Prisma query engine on Alpine) RUN apk add --no-cache python3 make g++ openssl openssl-dev -# Copy package manifests -COPY package*.json ./ -COPY client/package*.json ./client/ +# Configure npm: disable package-lock update, cap network retries/timeout +RUN npm config set fetch-retry-mintimeout 5000 \ + && npm config set fetch-retry-maxtimeout 30000 \ + && npm config set fetch-retries 3 \ + && npm config set prefer-offline false -# Install all dependencies (dev deps needed for prisma CLI + tsc build) -RUN npm install -RUN cd client && npm install +# Copy lockfiles + manifests together so npm ci can validate the lockfile +COPY package.json package-lock.json ./ +COPY client/package.json client/package-lock.json ./client/ + +# Use npm ci (lockfile-exact, no resolution step, much faster than npm install) +RUN npm ci +RUN cd client && npm ci # Copy source COPY . .