Fix Dockerfiles: use npm install if package-lock.json missing

This commit is contained in:
XPS\Micro 2026-01-30 23:14:30 +01:00
parent 9e352f7430
commit d4af469207
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ WORKDIR /app
# Dependencies
COPY package.json package-lock.json* ./
RUN npm ci
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
# Source code
COPY . .

View File

@ -4,7 +4,7 @@ FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
COPY . .
RUN npm run build