version: "3.9" # ============================================================ # SmallClaw Voice – docker-compose.voice.yml # ============================================================ # Voice-enabled deployment with ffmpeg, whisper.cpp (STT), Piper (TTS). # # Usage: # docker compose -f docker-compose.voice.yml up -d # docker compose -f docker-compose.voice.yml logs -f # docker compose -f docker-compose.voice.yml down # # Config: mount your config.json with voice.enabled=true # or set voice config via environment variables below. # ============================================================ services: # ── Ollama ──────────────────────────────────────────────── ollama: image: ollama/ollama:latest container_name: smallclaw-ollama restart: unless-stopped profiles: - ollama ports: - "11434:11434" volumes: - ollama_data:/root/.ollama environment: - OLLAMA_HOST=0.0.0.0 healthcheck: test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"] interval: 20s timeout: 10s retries: 5 start_period: 10s # ── Model pull (one-shot init, Ollama only) ────────────── model-init: image: ollama/ollama:latest container_name: smallclaw-model-init profiles: - ollama depends_on: ollama: condition: service_healthy volumes: - ollama_data:/root/.ollama environment: - OLLAMA_HOST=http://ollama:11434 - DEFAULT_MODEL=${SMALLCLAW_DEFAULT_MODEL:-qwen3:4b} entrypoint: > sh -c " echo '>>> Pulling model: '$$DEFAULT_MODEL; ollama pull $$DEFAULT_MODEL; echo '>>> Done.'; " restart: "no" # ── SmallClaw Gateway (Voice-enabled) ──────────────────── smallclaw: build: context: . dockerfile: Dockerfile.voice container_name: smallclaw-voice restart: unless-stopped ports: - "${HOST_PORT:-18789}:18789" extra_hosts: - "host.docker.internal:host-gateway" # Telegram API DNS fix — use working IP - "api.telegram.org:149.154.167.220" volumes: - smallclaw_data:/data - smallclaw_workspace:/data/workspace - ${LOCALCLAW_CONFIG_DIR:-~/.localclaw}:/root/.localclaw environment: - NODE_ENV=production - DOCKER_CONTAINER=true - GATEWAY_PORT=18789 - GATEWAY_HOST=0.0.0.0 - SMALLCLAW_DATA_DIR=/data - SMALLCLAW_WORKSPACE_DIR=/data/workspace # Provider - SMALLCLAW_PROVIDER=${SMALLCLAW_PROVIDER:-ollama} # Ollama - OLLAMA_HOST=${OLLAMA_HOST:-http://ollama:11434} # LM Studio - LM_STUDIO_ENDPOINT=${LM_STUDIO_ENDPOINT:-http://host.docker.internal:1234} - LM_STUDIO_API_KEY=${LM_STUDIO_API_KEY:-} - LM_STUDIO_MODEL=${LM_STUDIO_MODEL:-} # llama.cpp - LLAMA_CPP_ENDPOINT=${LLAMA_CPP_ENDPOINT:-http://host.docker.internal:8080} - LLAMA_CPP_MODEL=${LLAMA_CPP_MODEL:-} # OpenAI - OPENAI_API_KEY=${OPENAI_API_KEY:-} - OPENAI_MODEL=${OPENAI_MODEL:-gpt-4o} # OpenAI Codex - CODEX_MODEL=${CODEX_MODEL:-gpt-5.3-codex} # Voice paths (built into image) - PIPER_MODEL_PATH=/usr/local/share/piper-voices/ko_KR-kss-medium.onnx - PIPER_CONFIG_PATH=/usr/local/share/piper-voices/ko_KR-kss-medium.onnx.json - WHISPER_MODEL_PATH=/usr/local/share/whisper-models/ggml-base.bin healthcheck: test: ["CMD", "curl", "-f", "http://localhost:18789/health"] interval: 30s timeout: 10s retries: 3 start_period: 30s volumes: ollama_data: driver: local smallclaw_data: driver: local smallclaw_workspace: driver: local