File size: 2,267 Bytes
e4d7d50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
version: "3.9"

# ─────────────────────────────────────────────────────────────────────────────
# ChessEcon — Full stack
#
# Services:
#   backend   — Python FastAPI WebSocket server (Qwen + GRPO)
#   dashboard — React/Node.js dashboard (Manus web project)
#
# Quick start (GPU machine):
#   cp backend/.env.example backend/.env   # fill in HF_TOKEN etc.
#   docker compose up --build
#
# The dashboard is served on port 3000.
# The backend WebSocket is on port 8000 (/ws).
# In LIVE mode the dashboard connects to ws://localhost:8000/ws
# (or set VITE_WS_URL to override).
# ─────────────────────────────────────────────────────────────────────────────

services:

  # ── Python backend (Qwen + GRPO + WebSocket) ─────────────────────────────
  backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
    image: chessecon-backend:latest
    container_name: chessecon-backend
    restart: unless-stopped
    ports:
      - "8008:8000"
    env_file:
      - ./backend/.env          # create from env-vars-reference.md
    environment:
      - DEVICE=auto             # override with "cpu" if no GPU
      - HOST=0.0.0.0
      - PORT=8000
    volumes:
      - hf_cache:/app/.cache/huggingface   # persist model weights
      - checkpoints:/app/checkpoints       # persist LoRA adapters
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 120s      # allow time for model download

  # ── React dashboard (Node.js dev server) ─────────────────────────────────
  dashboard:
    image: nginx:alpine
    container_name: chessecon-dashboard
    restart: unless-stopped
    ports:
     - "3006:80"
    volumes:
     - ./frontend/dist/public:/usr/share/nginx/html:ro

volumes:
  hf_cache:
  checkpoints: