zeroclaw/docker-compose.yml
Vernon Stinebaker d5e8fc1652
fix(config): apply env overrides at runtime and fix Docker compose defaults (#279)
- Call apply_env_overrides() after Config::load_or_init() in main.rs so
  environment variables (API_KEY, PROVIDER, ZEROCLAW_GATEWAY_PORT, etc.)
  are actually applied at runtime, not just in tests
- Add ZEROCLAW_ALLOW_PUBLIC_BIND env var support for gateway bind policy
- Fix docker-compose.yml: correct volume path (/zeroclaw-data not /data),
  add ZEROCLAW_ALLOW_PUBLIC_BIND=true for container networking, make host
  port configurable via HOST_PORT env var
- Add docker-compose.override.yml to .gitignore for local dev overrides
2026-02-16 02:12:49 -05:00

51 lines
1.4 KiB
YAML

# ZeroClaw Docker Compose Example
#
# Quick start:
# 1. Copy this file and set your API key
# 2. Run: docker-compose up -d
# 3. Access gateway at http://localhost:3000
#
# For more info: https://github.com/theonlyhennygod/zeroclaw
services:
zeroclaw:
image: ghcr.io/theonlyhennygod/zeroclaw:latest
# Or build locally:
# build: .
container_name: zeroclaw
restart: unless-stopped
environment:
# Required: Your LLM provider API key
- API_KEY=${API_KEY:-}
# Or use the prefixed version:
# - ZEROCLAW_API_KEY=${ZEROCLAW_API_KEY:-}
# Optional: LLM provider (default: openrouter)
# Options: openrouter, openai, anthropic, ollama
- PROVIDER=${PROVIDER:-openrouter}
# Allow public bind inside Docker (required for container networking)
- ZEROCLAW_ALLOW_PUBLIC_BIND=true
# Optional: Model override
# - ZEROCLAW_MODEL=anthropic/claude-sonnet-4-20250514
volumes:
# Persist workspace and config (must match WORKDIR/HOME in Dockerfile)
- zeroclaw-data:/zeroclaw-data
ports:
# Gateway API port (override HOST_PORT if 3000 is taken)
- "${HOST_PORT:-3000}:3000"
# Health check
healthcheck:
test: ["CMD", "zeroclaw", "doctor"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
volumes:
zeroclaw-data: