File size: 1,793 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
63
64
version: "3.9"

# ChessEcon — OpenEnv 0.1 compliant multi-agent chess economy
#
# White: Qwen/Qwen2.5-0.5B-Instruct  (GRPO training target)
# Black: meta-llama/Llama-3.2-1B-Instruct  (fixed opponent)
#
# Quick start:
#   docker compose up --build

services:

  backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
    image: chessecon-backend:latest
    container_name: chessecon-backend
    restart: unless-stopped
    ports:
      - "8008:8000"
    env_file:
      - ./backend/.env
    environment:
      - DEVICE=cuda                                         # GPU inference
      - HOST=0.0.0.0
      - PORT=8000
      - WHITE_MODEL=/models/Qwen_Qwen2.5-0.5B-Instruct
      - BLACK_MODEL=/models/meta-llama_Llama-3.2-1B-Instruct
      - HF_HUB_OFFLINE=1
      - CUDA_VISIBLE_DEVICES=0                             # use first GPU
    volumes:
      - ./training/models:/models:ro                                   # model weights
      - /home/minasm/.cache/huggingface:/root/.cache/huggingface:ro    # HF cache
      - checkpoints:/app/checkpoints                                    # LoRA checkpoints
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 180s

  dashboard:
    image: nginx:alpine
    container_name: chessecon-dashboard
    restart: unless-stopped
    ports:
      - "3006:80"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - ./frontend/dist/public:/usr/share/nginx/html:ro
      - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro

volumes:
  checkpoints: