managarten/games/mana-games/apps/web/Dockerfile
Till JS ecd7770eba feat(mana-games): add Dockerfile, server hooks, error tracking, and feedback page
Production-ready Dockerfile on port 5210, security headers and analytics
injection via hooks.server.ts, GlitchTip error tracking, and feedback page
using shared feedback package.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:02:15 +02:00

29 lines
1.1 KiB
Docker

# syntax=docker/dockerfile:1
FROM sveltekit-base:local AS builder
ARG PUBLIC_MANA_CORE_AUTH_URL=http://mana-auth:3001
ENV PUBLIC_MANA_CORE_AUTH_URL=$PUBLIC_MANA_CORE_AUTH_URL
COPY games/mana-games/apps/web ./games/mana-games/apps/web
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
pnpm install --no-frozen-lockfile --ignore-scripts
WORKDIR /app/games/mana-games/apps/web
RUN pnpm exec svelte-kit sync
RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm build
FROM node:20-alpine AS production
WORKDIR /app/games/mana-games/apps/web
COPY --from=builder /app/node_modules/.pnpm /app/node_modules/.pnpm
COPY --from=builder /app/games/mana-games/apps/web/node_modules ./node_modules
COPY --from=builder /app/games/mana-games/apps/web/build ./build
COPY --from=builder /app/games/mana-games/apps/web/package.json ./
EXPOSE 5210
ENV NODE_ENV=production PORT=5210 HOST=0.0.0.0
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:5210/health || exit 1
CMD ["node", "build"]