Files
QR-Invoice/Dockerfile

35 lines
662 B
Docker

FROM node:18-alpine AS builder
WORKDIR /app
# Alle Dependencies installieren (inkl. devDependencies für Build)
COPY package*.json ./
RUN npm ci
# Source kopieren und builden
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
# Production Stage
FROM node:18-alpine
WORKDIR /app
# Nur Production Dependencies
COPY package*.json ./
RUN npm ci --only=production
# Built files vom Builder kopieren
COPY --from=builder /app/dist ./dist
# Port freigeben
EXPOSE 3000
# Healthcheck
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -q --spider http://127.0.0.1:3000/health || exit 1
# Starten
CMD ["node", "dist/index.js"]