feat: initial commit — World Cup stats app with pnpm, Traefik, Docker
Full-stack World Cup web app (1930–2026): - Next.js 16 + TailwindCSS 4 + GraphQL Yoga + Apollo Client 4 + Drizzle + PostgreSQL 16 - 23 tournaments synced from openfootball/worldcup.json (matches, goals, teams, stadiums, squads, standings) - Pages: home (live), groups, stats, history, search, /tournaments/[year], /teams/[slug], /players/[name] - Live match detection via isLive() + Apollo 60 s poll - pnpm with node-linker=hoisted for Docker compatibility - docker-compose.yml with Traefik labels (HTTPS redirect, TLS, security middleware) - docker-compose.dev.yml for local dev (DB only, port 5432 exposed) - Dockerfile: multi-stage pnpm build, standalone Next.js output, sync script bundled - .env.example with all required variables documented - Comprehensive README with local dev, deployment, schema, and GraphQL API reference Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DATABASE_URL: postgres://wc:${DB_PASSWORD}@db:5432/worldcup
|
||||
NODE_ENV: production
|
||||
labels:
|
||||
- "traefik.enable=${TRAEFIK_ENABLED:-false}"
|
||||
- "traefik.http.middlewares.worldcup-redirect-web-secure.redirectscheme.scheme=https"
|
||||
- "traefik.http.routers.worldcup-web.middlewares=worldcup-redirect-web-secure"
|
||||
- "traefik.http.routers.worldcup-web.rule=Host(`${TRAEFIK_HOST}`)"
|
||||
- "traefik.http.routers.worldcup-web.entrypoints=web"
|
||||
- "traefik.http.routers.worldcup-web-secure.rule=Host(`${TRAEFIK_HOST}`)"
|
||||
- "traefik.http.routers.worldcup-web-secure.tls.certresolver=resolver"
|
||||
- "traefik.http.routers.worldcup-web-secure.entrypoints=web-secure"
|
||||
- "traefik.http.routers.worldcup-web-secure.middlewares=security-headers@file,no-index@file"
|
||||
- "traefik.http.services.worldcup-web-secure.loadbalancer.server.port=3000"
|
||||
- "traefik.docker.network=${NETWORK_NAME}"
|
||||
networks:
|
||||
- compose_network
|
||||
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: worldcup
|
||||
POSTGRES_USER: wc
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U wc -d worldcup"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
networks:
|
||||
- compose_network
|
||||
|
||||
networks:
|
||||
compose_network:
|
||||
name: ${NETWORK_NAME}
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
Reference in New Issue
Block a user