We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f91c469 commit 71a4c6eCopy full SHA for 71a4c6e
1 file changed
CogniwareIms/frontend/Dockerfile
@@ -7,8 +7,16 @@ RUN apk add --no-cache libc6-compat
7
WORKDIR /app
8
9
# Install dependencies (including dev dependencies for build)
10
-COPY frontend/package.json frontend/package-lock.json* ./
11
-RUN npm ci
+COPY frontend/package.json ./
+# Copy package-lock.json if it exists (wildcard makes it optional)
12
+COPY frontend/package-lock.json* ./
13
+# Use npm ci if lockfile exists and is valid, otherwise fall back to npm install
14
+RUN if [ -f package-lock.json ] && [ -s package-lock.json ]; then \
15
+ npm ci --legacy-peer-deps || npm install; \
16
+ else \
17
+ echo "No valid package-lock.json found, using npm install"; \
18
+ npm install; \
19
+ fi
20
21
# Rebuild the source code only when needed
22
FROM base AS builder
0 commit comments