- Dockerfile: node:24-alpine, production deps only, runs as the node user, healthcheck on /healthz. No volume, because the server keeps no state. - docker-compose.yml: example for the VPS. It publishes no ports, since Docker's port publishing bypasses ufw and would skip NPM's IP access list. It joins NPM's network instead. - .gitea/workflows/docker.yml: on v*-prod* tags, builds on the self-hosted runner and pushes v0idf1sh/sdp-dashboard:<tag> and :latest using the DHUB_UNAME and DHUB_PASS secrets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
499 B
Docker
20 lines
499 B
Docker
FROM node:24-alpine
|
|
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
|
|
# install dependencies first so code-only changes reuse this layer
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --omit=dev && npm cache clean --force
|
|
|
|
COPY src ./src
|
|
|
|
# no volume: sessions live in each user's browser, so the container keeps no state
|
|
USER node
|
|
EXPOSE 3000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD wget -qO- http://127.0.0.1:3000/healthz || exit 1
|
|
|
|
CMD ["node", "src/server.js"]
|