ai-code-battle/docker-compose.workers.yml
jedarden 23186b77e1 Start Phase 6: Add deployment configuration and containers
- Add Dockerfile for acb-worker match execution container
- Add docker-compose.bots.yml for orchestrating all 6 strategy bots
- Add docker-compose.workers.yml for worker and indexer deployment
- Add .env.example documenting all required environment variables
- Add DEPLOYMENT.md with deployment guide and troubleshooting
- Update PROGRESS.md with Phase 6 progress

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 09:41:14 -04:00

61 lines
1.9 KiB
YAML

# AI Code Battle - Rackspace Worker Deployment
# Runs match workers and index builder on Rackspace Spot
#
# Usage:
# docker-compose -f docker-compose.workers.yml up -d
#
# Environment variables (set in .env or pass directly):
# ACB_API_ENDPOINT - Worker API URL (e.g., https://api.aicodebattle.com)
# ACB_API_KEY - Worker API key for authentication
# ACB_R2_ENDPOINT - R2 endpoint URL
# ACB_R2_BUCKET - R2 bucket name
# ACB_R2_ACCESS_KEY - R2 access key ID
# ACB_R2_SECRET_KEY - R2 secret access key
services:
# Match execution worker
worker:
build:
context: .
dockerfile: cmd/acb-worker/Dockerfile
environment:
- ACB_API_ENDPOINT=${ACB_API_ENDPOINT:-http://host.docker.internal:8787}
- ACB_API_KEY=${ACB_API_KEY:?ACB_API_KEY is required}
- ACB_R2_ENDPOINT=${ACB_R2_ENDPOINT}
- ACB_R2_BUCKET=${ACB_R2_BUCKET:-acb-data}
- ACB_R2_ACCESS_KEY=${ACB_R2_ACCESS_KEY}
- ACB_R2_SECRET_KEY=${ACB_R2_SECRET_KEY}
- ACB_WORKER_ID=${ACB_WORKER_ID:-}
- ACB_VERBOSE=${ACB_VERBOSE:-false}
command: ["-poll=5s", "-heartbeat=30s", "-timeout=3s"]
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
deploy:
replicas: 1
resources:
limits:
memory: 512M
reservations:
memory: 256M
# Index builder - runs periodically to rebuild static JSON files
# Run manually: docker-compose -f docker-compose.workers.yml run indexer
indexer:
build:
context: ./cmd/acb-indexer
dockerfile: Dockerfile
environment:
- API_URL=${ACB_API_ENDPOINT:-http://host.docker.internal:8787}
- API_KEY=${ACB_API_KEY:?ACB_API_KEY is required}
- OUTPUT_DIR=/app/data
- DEPLOY_COMMAND=${DEPLOY_COMMAND:-}
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- indexer-data:/app/data
profiles:
- manual
volumes:
indexer-data: