4e4e75a1d8
Mirrors the TTRPG stack (strict TS, Tailwind 4, vite-plugin-pwa, esbuild server bundle, multi-stage Dockerfile, Traefik compose). Floodlit-pitch design tokens, UI primitives (Button/Card/Badge), TanStack Router shell with Live/Groups/ Bracket/Predict/Story routes (placeholders), dependency-free PWA icon generator. Raw data staged: openfootball 2026 fixtures + martj42 international results CSV. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
23 lines
807 B
Docker
23 lines
807 B
Docker
# --- build stage: generate data, bundle the PWA + the live server ---
|
|
FROM oven/bun:1 AS build
|
|
WORKDIR /app
|
|
COPY package.json bun.lock* bun.lockb* ./
|
|
RUN bun install
|
|
COPY . .
|
|
RUN bun run data:build # icons + fixtures.json + ratings.json → public/
|
|
RUN bun run build # tsc -b && vite build → /app/dist
|
|
RUN bun run build:server # esbuild → /app/server/dist/index.js
|
|
|
|
# --- runtime stage: small node image, non-root, serves dist + /ws + /api ---
|
|
FROM node:20-slim AS runtime
|
|
ENV NODE_ENV=production STATIC_DIR=/app/dist PORT=8787
|
|
WORKDIR /app/server
|
|
COPY server/package.json ./
|
|
RUN npm install --omit=dev --no-audit --no-fund
|
|
COPY --from=build /app/server/dist ./dist
|
|
COPY --from=build /app/dist /app/dist
|
|
RUN chown -R node:node /app
|
|
USER node
|
|
EXPOSE 8787
|
|
CMD ["node", "dist/index.js"]
|