Skip to content

Commit bd58b92

Browse files
Updat docker file in Fronend Folder
Signed-off-by: cogniware-devops <[email protected]>
1 parent 3f1a204 commit bd58b92

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

CogniwareIms/frontend/Dockerfile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ RUN apk add --no-cache libc6-compat
77
WORKDIR /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
1723
FROM base AS builder

0 commit comments

Comments
 (0)