Files
politickekarty/Dockerfile
T
2026-11-17 17:51:13 +01:00

19 lines
623 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Politické karty – no npm dependencies, so no install step is needed.
FROM node:22-alpine
ENV NODE_ENV=production PORT=3000
WORKDIR /app
# Copy only what the server needs at runtime; files stay owned by root (read-only for the app user).
COPY package.json server.js ./
COPY public ./public
# Run as the unprivileged "node" user that ships with the image.
USER node
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||3000)+'/api/ping').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
CMD ["node", "server.js"]