Files
hitstar/Dockerfile
Elmar Kresse 1332880697
All checks were successful
Build and Push Docker Image / docker (push) Successful in 14s
refactor: improve dependency installation logic in Dockerfile
2025-09-04 17:37:05 +02:00

24 lines
556 B
Docker

# Lightweight production image for the Hitstar Node app
FROM node:22-alpine
WORKDIR /app
# Install dependencies
COPY package*.json ./
# 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 . .
ENV NODE_ENV=production \
PORT=5173
EXPOSE 5173
CMD ["node", "src/server/index.js"]