mirror of
https://github.com/guyg1474/hcrb.git
synced 2026-10-15 23:13:28 +02:00
21 lines
554 B
Docker
21 lines
554 B
Docker
FROM node:22-alpine
|
|
|
|
ENV NODE_ENV=production \
|
|
TZ=Europe/Berlin
|
|
WORKDIR /app
|
|
|
|
# Erst nur die Paketlisten kopieren, damit npm ci bei Code-Änderungen aus dem Cache kommt
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --omit=dev && npm cache clean --force
|
|
|
|
COPY . .
|
|
RUN mkdir -p data && chown node:node data
|
|
|
|
USER node
|
|
EXPOSE 3000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD node -e "fetch('http://127.0.0.1:3000/api/me').then((r) => process.exit(r.ok ? 0 : 1), () => process.exit(1))"
|
|
|
|
CMD ["node", "server.js"]
|