Skip to content

Commit 4826266

Browse files
committed
server: tolerate missing package-lock.json in build context (npm ci || npm install)
1 parent f7efeec commit 4826266

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/server/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Dockerfile for editor mock API (TypeScript/Express)
22
FROM node:18-alpine AS build
33
WORKDIR /app
4-
COPY package.json package-lock.json ./
5-
RUN npm ci --production=false
4+
# Copy only package.json from the build context. The repo root package-lock.json
5+
# is not available when building from the subfolder context, which caused
6+
# BuildKit checksum errors. Use npm ci when a lockfile exists, otherwise
7+
# fall back to npm install so the build doesn't fail.
8+
COPY package.json ./
9+
RUN npm ci --production=false || npm install --production=false
610
COPY tsconfig.json ./
711
COPY src ./src
812
RUN npm run build

0 commit comments

Comments
 (0)