173 lines
4.7 KiB
YAML
173 lines
4.7 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
fifa2026-postgres:
|
|
image: timescale/timescaledb:latest-pg16
|
|
environment:
|
|
POSTGRES_USER: fifa_user
|
|
POSTGRES_PASSWORD: change_me
|
|
POSTGRES_DB: fifa2026
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- pg-data:/var/lib/postgresql/data
|
|
- ./platform/backend/db_init_timescaledb.sql:/docker-entrypoint-initdb.d/init.sql
|
|
networks:
|
|
- wc2026-net
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U fifa_user -d fifa2026"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
fifa2026-redis:
|
|
image: redis:7-alpine
|
|
command: redis-server --appendonly yes
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis-data:/data
|
|
networks:
|
|
- wc2026-net
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
fifa2026-backend:
|
|
build:
|
|
context: ./platform/backend
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- ./platform/backend:/app
|
|
environment:
|
|
- DATABASE_URL=postgresql+asyncpg://fifa_user:change_me@fifa2026-postgres:5432/fifa2026
|
|
- REDIS_URL=redis://fifa2026-redis:6379/0
|
|
- THE_ODDS_API_KEY=${THE_ODDS_API_KEY:-}
|
|
depends_on:
|
|
fifa2026-seed:
|
|
condition: service_completed_successfully
|
|
fifa2026-postgres:
|
|
condition: service_healthy
|
|
fifa2026-redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- wc2026-net
|
|
|
|
fifa2026-seed:
|
|
build:
|
|
context: ./platform/backend
|
|
command: ["python", "-m", "app.analytics.worldcup_seed"]
|
|
volumes:
|
|
- ./platform/backend:/app
|
|
environment:
|
|
- DATABASE_URL=postgresql+asyncpg://fifa_user:change_me@fifa2026-postgres:5432/fifa2026
|
|
depends_on:
|
|
fifa2026-postgres:
|
|
condition: service_healthy
|
|
networks:
|
|
- wc2026-net
|
|
|
|
fifa2026-odds-worker:
|
|
build:
|
|
context: ./platform/backend
|
|
command: ["python", "-m", "app.analytics.crawler"]
|
|
volumes:
|
|
- ./platform/backend:/app
|
|
environment:
|
|
- DATABASE_URL=postgresql+asyncpg://fifa_user:change_me@fifa2026-postgres:5432/fifa2026
|
|
- REDIS_URL=redis://fifa2026-redis:6379/0
|
|
- THE_ODDS_API_KEY=${THE_ODDS_API_KEY:-}
|
|
- THE_ODDS_BASE=${THE_ODDS_BASE:-https://api.the-odds-api.com}
|
|
- THE_ODDS_SPORT_KEY=${THE_ODDS_SPORT_KEY:-soccer_fifa_world_cup}
|
|
- THE_ODDS_REGIONS=${THE_ODDS_REGIONS:-eu}
|
|
- THE_ODDS_MARKETS=${THE_ODDS_MARKETS:-h2h,spreads,totals,btts}
|
|
- ODDS_POLL_INTERVAL_SECONDS=${ODDS_POLL_INTERVAL_SECONDS:-300}
|
|
depends_on:
|
|
fifa2026-seed:
|
|
condition: service_completed_successfully
|
|
fifa2026-postgres:
|
|
condition: service_healthy
|
|
fifa2026-redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- wc2026-net
|
|
|
|
fifa2026-news-worker:
|
|
build:
|
|
context: ./platform/backend
|
|
command: ["python", "-m", "app.analytics.news_worker"]
|
|
volumes:
|
|
- ./platform/backend:/app
|
|
environment:
|
|
- REDIS_URL=redis://fifa2026-redis:6379/0
|
|
- NEWS_POLL_INTERVAL_SECONDS=${NEWS_POLL_INTERVAL_SECONDS:-900}
|
|
- NEWS_QUERY=${NEWS_QUERY:-2026 FIFA World Cup OR 2026 世界盃 OR 世界盃 2026}
|
|
depends_on:
|
|
fifa2026-redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- wc2026-net
|
|
|
|
fifa2026-fixtures-worker:
|
|
build:
|
|
context: ./platform/backend
|
|
command: ["python", "-m", "app.analytics.fixtures_worker"]
|
|
volumes:
|
|
- ./platform/backend:/app
|
|
environment:
|
|
- DATABASE_URL=postgresql+asyncpg://fifa_user:change_me@fifa2026-postgres:5432/fifa2026
|
|
- REDIS_URL=redis://fifa2026-redis:6379/0
|
|
- FIXTURES_JSON_URL=${FIXTURES_JSON_URL:-https://www.thestatsapi.com/world-cup/data/fixtures.json}
|
|
- FIXTURES_POLL_INTERVAL_SECONDS=${FIXTURES_POLL_INTERVAL_SECONDS:-21600}
|
|
depends_on:
|
|
fifa2026-seed:
|
|
condition: service_completed_successfully
|
|
fifa2026-postgres:
|
|
condition: service_healthy
|
|
fifa2026-redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- wc2026-net
|
|
|
|
fifa2026-web:
|
|
build:
|
|
context: ./platform/web
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- ./platform/web:/app
|
|
- /app/node_modules
|
|
- /app/.next
|
|
environment:
|
|
- NEXT_PUBLIC_API_URL=http://localhost:8000
|
|
depends_on:
|
|
- fifa2026-backend
|
|
networks:
|
|
- wc2026-net
|
|
|
|
fifa2026-alerts:
|
|
build:
|
|
context: ./platform/alerts
|
|
volumes:
|
|
- ./platform/alerts:/app
|
|
environment:
|
|
- REDIS_URL=redis://fifa2026-redis:6379/0
|
|
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-}
|
|
- TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID:-}
|
|
depends_on:
|
|
fifa2026-redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- wc2026-net
|
|
|
|
networks:
|
|
wc2026-net:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
pg-data:
|
|
redis-data:
|