zeroclaw/docker-compose.yml
Alex Gorevski da326b265d fix(container): address all container anti-patterns (4.1–4.4)
- Replace broad COPY . . with targeted COPY src/ and firmware/ to
  preserve Docker layer cache across non-build file changes (4.1)
- Inline permissions/config prep into builder stage, removing the
  extra busybox stage and its maintenance/security overhead (4.2)
- Strip heavy dev tools (vim, git, iputils-ping, openssl) from dev
  image, keeping only ca-certificates and curl (4.3)
- Replace expensive zeroclaw doctor healthcheck with lightweight
  zeroclaw status; increase interval from 30s to 60s (4.4)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 10:35:09 +08:00

62 lines
1.7 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/zeroclaw-labs/zeroclaw
services:
zeroclaw:
image: ghcr.io/zeroclaw-labs/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"
# Resource limits
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
# Health check — uses lightweight status instead of full diagnostics.
# For images with curl, prefer: curl -f http://localhost:3000/health
healthcheck:
test: ["CMD", "zeroclaw", "status"]
interval: 60s
timeout: 10s
retries: 3
start_period: 10s
volumes:
zeroclaw-data: