refactor: improve dependency installation logic in Dockerfile
All checks were successful
Build and Push Docker Image / docker (push) Successful in 14s

This commit is contained in:
2025-09-04 17:37:05 +02:00
parent cae0900d93
commit 1332880697

View File

@@ -5,7 +5,12 @@ WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm ci --omit=dev || npm install --omit=dev
# Use npm ci when a lockfile is present, otherwise fallback to npm install without throwing an error
RUN if [ -f package-lock.json ] || [ -f npm-shrinkwrap.json ]; then \
npm ci --omit=dev; \
else \
npm install --omit=dev; \
fi
# Copy app source (media lives outside via volume)
COPY . .