Skip to content

Commit 16a4264

Browse files
committed
Fix lockfile issue in Dockerfile
1 parent d938c6f commit 16a4264

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

Dockerfile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ WORKDIR ${FOLDER}
2020

2121
# Install dependencies based on the preferred package manager
2222
RUN \
23-
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
24-
elif [ -f package-lock.json ]; then npm ci || npm i; \
25-
elif [ -f pnpm-lock.yaml ]; then pnpm i --frozen-lockfile || pnpm i; \
26-
else echo "Lockfile not found." && exit 1; \
23+
if [ -f yarn.lock ]; then \
24+
yarn install --frozen-lockfile || yarn install; \
25+
elif [ -f package-lock.json ]; then \
26+
npm ci || npm install; \
27+
elif [ -f pnpm-lock.yaml ]; then \
28+
pnpm install --frozen-lockfile || pnpm install; \
29+
elif [ -f package.json ]; then \
30+
echo "Lockfile not found. Falling back to npm install (non-deterministic install)."; \
31+
npm install; \
32+
else \
33+
echo "No package manifest found. Skipping install."; \
2734
fi
28-
2935
# Rebuild the source code only when needed
3036
FROM base AS builder
3137
ARG FOLDER

0 commit comments

Comments
 (0)