services: # ── Backend: FastAPI RL environment ───────────────────────────── env: build: context: . dockerfile: Dockerfile ports: - "7860:7860" env_file: - .env environment: - ENV_URL=http://localhost:7860 - AGENT_MODEL_URL=http://host.docker.internal:8001 - JUDGE_MODE=${JUDGE_MODE:-full} - JUDGE_BASE_URL=http://host.docker.internal:8002/v1 - JUDGE_MODEL=${JUDGE_MODEL:-nvidia/nemotron-super-49b-v1} - JUDGE_API_KEY=${JUDGE_API_KEY:-local} extra_hosts: - "host.docker.internal:host-gateway" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:7860/health"] interval: 30s timeout: 10s retries: 3 start_period: 15s restart: unless-stopped # ── Frontend: Next.js demo UI ──────────────────────────────────── # NEXT_PUBLIC_* vars are baked into the browser bundle at build time. # The browser hits the backend at the HOST's port 7860 (via "localhost:7860" # in docker-compose on a single machine). Override API_URL with your # server's hostname/IP when deploying remotely. frontend: build: context: ./frontend dockerfile: Dockerfile args: - NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:7860} - NEXT_PUBLIC_API_KEY=${NEXT_PUBLIC_API_KEY:-meta_hack_2026} ports: - "3000:3000" environment: # Server-side NVIDIA keys — never baked into the browser bundle - NVIDIA_API_KEY_1=${NVIDIA_API_KEY_1:-} - NVIDIA_API_KEY_2=${NVIDIA_API_KEY_2:-} - NVIDIA_API_KEY_3=${NVIDIA_API_KEY_3:-} - NVIDIA_API_KEY_4=${NVIDIA_API_KEY_4:-} - NVIDIA_API_KEY_5=${NVIDIA_API_KEY_5:-} - NVIDIA_API_KEY_6=${NVIDIA_API_KEY_6:-} - NVIDIA_MODEL=${MODEL_NAME:-meta/llama-3.3-70b-instruct} depends_on: env: condition: service_healthy restart: unless-stopped # ── Inference agent (optional) ─────────────────────────────────── inference: build: context: . dockerfile: Dockerfile env_file: - .env environment: - ENV_URL=http://env:7860 depends_on: env: condition: service_healthy command: ["python", "inference.py"] profiles: - inference