Fix build hang: commit lockfile and use npm ci
Build and Push Docker Image / build (push) Successful in 16s
Build and Push Docker Image / build (push) Successful in 16s
The pipeline hung on `npm install` because no package-lock.json existed, forcing a full from-scratch dependency resolve on every build. Commit the resolved lockfile and switch the Dockerfile to `npm ci` for deterministic, fast installs. Add .dockerignore to keep the build context small. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+3
-1
@@ -3,7 +3,9 @@ FROM node:18-alpine AS frontend-build
|
||||
|
||||
WORKDIR /app/frontend
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm install --legacy-peer-deps
|
||||
# npm ci installs from the committed lockfile: deterministic and far faster
|
||||
# than a from-scratch resolve. --prefer-offline avoids redundant registry hits.
|
||||
RUN npm ci --legacy-peer-deps --prefer-offline --no-audit --fund=false
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
|
||||
Reference in New Issue
Block a user