Add Docker Compose deployment

This commit is contained in:
2026-05-05 14:23:45 -04:00
parent 01e1c78bf7
commit 7b6676cdc9
6 changed files with 67 additions and 4 deletions

17
Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM node:24-alpine
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
COPY package.json ./
COPY index.html styles.css game.js server.js ./
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) + '/healthz').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
CMD ["node", "server.js"]