services: db: image: mysql:8.0 restart: unless-stopped # Tuned for a 1 GB host. Bump innodb-buffer-pool-size on 2GB+ boxes. command: > --default-authentication-plugin=caching_sha2_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb-buffer-pool-size=128M --max-connections=50 environment: MYSQL_DATABASE: talent_engine MYSQL_USER: talent_engine MYSQL_PASSWORD: ${MYSQL_PASSWORD:?set MYSQL_PASSWORD in .env} MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:?set MYSQL_ROOT_PASSWORD in .env} volumes: - mysql_data:/var/lib/mysql healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-u", "talent_engine", "-p${MYSQL_PASSWORD}"] interval: 10s timeout: 5s retries: 10 api: image: talent-engine-api:latest build: context: ./api args: # Outside mainland China, set PIP_INDEX_URL=https://pypi.org/simple/ # in your shell before `docker compose build` to skip the slow Aliyun fetch. PIP_INDEX_URL: ${PIP_INDEX_URL:-https://mirrors.aliyun.com/pypi/simple/} restart: unless-stopped depends_on: db: condition: service_healthy environment: PORT: 8000 DATABASE_URL: mysql://talent_engine:${MYSQL_PASSWORD}@db:3306/talent_engine LLM_PROVIDER: ${LLM_PROVIDER} GEMINI_API_KEY: ${GEMINI_API_KEY:-} QWEN_API_KEY: ${QWEN_API_KEY:-} HUNYUAN_API_KEY: ${HUNYUAN_API_KEY:-} DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY:-} CORS_ORIGINS: ${CORS_ORIGINS:-*} # Per-call email notifications. All three must be set or the notifier # stays off (which is the right default for a local `compose up`). E2A_API_KEY: ${E2A_API_KEY:-} E2A_AGENT_EMAIL: ${E2A_AGENT_EMAIL:-} E2A_NOTIFY_TO: ${E2A_NOTIFY_TO:-} E2A_NOTIFY_ENABLED: ${E2A_NOTIFY_ENABLED:-1} ports: # Host port 8002 (8000/8001 are commonly used by mnexa-ai's local stack). # Container listens on 8000 — the in-container PORT. - "127.0.0.1:8002:8000" volumes: mysql_data: