services: agent: # image: agent:latest build: . ports: - "${GATEWAY_PORT:-8787}:${GATEWAY_PORT:-8787}" environment: # ── Run mode ─────────────────────────────────────────────────────────── # gateway (default) starts the HTTP gateway + web UI # single runs one-shot prompt mode (PROMPT/stdin) and exits - RUN_MODE=${RUN_MODE:-gateway} # ── Gateway server ───────────────────────────────────────────────────── - GATEWAY_HOST=0.0.0.0 - GATEWAY_PORT=${GATEWAY_PORT:-8787} - GATEWAY_CORS_ORIGIN=${GATEWAY_CORS_ORIGIN:-} - GATEWAY_AUTH_TOKEN=${GATEWAY_AUTH_TOKEN:-} - GATEWAY_ENABLE_WEB_UI=${GATEWAY_ENABLE_WEB_UI:-true} # ── Model ────────────────────────────────────────────────────────────── # Both PROVIDER and MODEL must be set together to select a specific model. # If omitted, the agent uses the first available / settings model. - PROVIDER=${PROVIDER:-anthropic} - MODEL=${MODEL:-claude-sonnet-4-20250514} # ── API keys ─────────────────────────────────────────────────────────── # Generic key injected at runtime for the chosen PROVIDER: - API_KEY=${API_KEY:-} # Provider-specific keys (pi-ai reads these automatically): - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-} - OPENAI_API_KEY=${OPENAI_API_KEY:-} - GEMINI_API_KEY=${GEMINI_API_KEY:-} - MISTRAL_API_KEY=${MISTRAL_API_KEY:-} - GROQ_API_KEY=${GROQ_API_KEY:-} - CEREBRAS_API_KEY=${CEREBRAS_API_KEY:-} - XAI_API_KEY=${XAI_API_KEY:-} - OPENROUTER_API_KEY=${OPENROUTER_API_KEY:-} - AI_GATEWAY_API_KEY=${AI_GATEWAY_API_KEY:-} # ── Ollama (local / self-hosted) ─────────────────────────────────────── # To use Ollama set PROVIDER=ollama and MODEL=, e.g.: # PROVIDER=ollama MODEL=llama3.2 docker compose up # host.docker.internal resolves to the Docker host on Mac/Windows. # On Linux add the extra_hosts entry below (already included). - OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://host.docker.internal:11434/v1} - OLLAMA_CONTEXT_WINDOW=${OLLAMA_CONTEXT_WINDOW:-32768} - OLLAMA_MAX_TOKENS=${OLLAMA_MAX_TOKENS:-8192} # ── Prompt (single mode only) ───────────────────────────────────────── # Used only when RUN_MODE=single. - PROMPT=${PROMPT:-} # ── System prompt ────────────────────────────────────────────────────── - SYSTEM_PROMPT=${SYSTEM_PROMPT:-} - APPEND_SYSTEM_PROMPT=${APPEND_SYSTEM_PROMPT:-} # ── Thinking ─────────────────────────────────────────────────────────── # off | minimal | low | medium | high | xhigh - THINKING_LEVEL=${THINKING_LEVEL:-off} # ── Tools ────────────────────────────────────────────────────────────── # all | readonly | none | read,bash,edit,write - TOOLS=${TOOLS:-all} # ── Working directory (Docker volume mount target) ────────────────────── - CWD=/app # ── Session persistence ──────────────────────────────────────────────── - SESSION_PERSIST=${SESSION_PERSIST:-true} # ── Verbose tool logging ─────────────────────────────────────────────── - VERBOSE_TOOLS=${VERBOSE_TOOLS:-false} volumes: - ./data:/app # Allows the container to reach Ollama (or any service) on the Docker host. # On Mac/Windows host.docker.internal works without this; on Linux it needs # this mapping to be resolved correctly. extra_hosts: - "host.docker.internal:host-gateway"