refactor: improve dependency installation logic in Dockerfile
All checks were successful
Build and Push Docker Image / docker (push) Successful in 14s
All checks were successful
Build and Push Docker Image / docker (push) Successful in 14s
This commit is contained in:
@@ -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 . .
|
||||
|
||||
Reference in New Issue
Block a user