File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,17 @@ RUN apk add --no-cache libc6-compat
77WORKDIR /app
88
99# Install dependencies (including dev dependencies for build)
10- # Copy package files - ensure both are copied explicitly
11- COPY frontend/package.json ./
12- COPY frontend/package-lock.json ./
13- # Use npm ci for deterministic builds (requires package-lock.json)
14- RUN npm ci --legacy-peer-deps || (echo "Warning: npm ci failed, falling back to npm install" && npm install --legacy-peer-deps)
10+ # Copy package files - copy all package*.json files from frontend
11+ # This handles both package.json and package-lock.json if it exists
12+ COPY frontend/package*.json ./
13+ # Use npm ci if lock file exists, otherwise use npm install
14+ RUN if [ -f package-lock.json ]; then \
15+ echo "Found package-lock.json, using npm ci for deterministic build" ; \
16+ npm ci --legacy-peer-deps || (echo "npm ci failed, falling back to npm install" && npm install --legacy-peer-deps); \
17+ else \
18+ echo "package-lock.json not found, using npm install" ; \
19+ npm install --legacy-peer-deps; \
20+ fi
1521
1622# Rebuild the source code only when needed
1723FROM base AS builder
You can’t perform that action at this time.
0 commit comments