← Back to PRs

#21096: [codex] Add host-gateway + Ollama API env defaults to compose

by BoarderOnATrip open 2026-02-19 17:04 View on GitHub →
docker size: XS
## Summary This change updates `docker-compose.yml` so the OpenClaw gateway and CLI containers can reliably reach a host-installed Ollama instance without extra local tweaks. ## Problem Local Ollama access from containers can fail or be inconsistent across Linux Docker environments when `host.docker.internal` is not mapped. In addition, the Ollama API key/env behavior was implicit, which could create mismatches between provider config and container runtime environment. ## User Impact When users configure Ollama as a local provider, containerized OpenClaw commands may fail to connect to Ollama or behave inconsistently depending on host networking setup. ## Root Cause - `host.docker.internal` was not explicitly mapped in this compose file. - `OLLAMA_API_KEY` was not explicitly set in container env for gateway/CLI services. ## Fix - Added `extra_hosts` mapping for both relevant services: - `host.docker.internal:host-gateway` - Added explicit env default for both services: - `OLLAMA_API_KEY: ${OLLAMA_API_KEY:-ollama-local}` ## Validation - Rendered compose config successfully: - `docker compose -f docker-compose.yml config` - Confirmed only `docker-compose.yml` was committed for this change. ## Notes - Left unrelated untracked local backup file (`.env.bak-20260217-104800`) out of this PR.

Most Similar PRs