services: # --- LLM ENGINE --- ollama: build: context: ./ollama args: - BASE_IMAGE=ollama/ollama:rocm container_name: ollama restart: always shm_size: ${SHM_SIZE} privileged: true devices: - /dev/dri:/dev/dri:rwm group_add: - 109 volumes: - ./storage/ollama_models:/root/.ollama environment: - OLLAMA_HOST=0.0.0.0:11434 - MODEL_LIST=${MODEL_LIST} - OLLAMA_KEEP_ALIVE=${OLLAMA_KEEP_ALIVE} - OLLAMA_FLASH_ATTENTION=1 ports: - "11434:11434" dns: - ${DNS_SERVER} networks: - net.ghost.openclaw # --- CORE AGENT (GATEWAY) --- agent: image: ghcr.io/openclaw/openclaw:latest container_name: openclaw-agent depends_on: - ollama userns_mode: "keep-id" environment: - OPENCLAW_GATEWAY_MODE=local - OPENCLAW_GATEWAY_PASSWORD=${OPENCLAW_PASSWORD} - OLLAMA_URL=http://127.0.0.1:11434 - OLLAMA_API_KEY=ollama-local ports: - "8080:8080" volumes: - ${HOST_OPENCLAW_JSON_PATH}:/home/node/.openclaw/openclaw.json:Z - ${HOST_WORKSPACE_PATH}:/home/node/.openclaw/workspace:Z,U - ${HOST_REPOS_PATH}:/repos:Z,U networks: - net.ghost.openclaw # --- NETWORK TUNNEL (SIDECAR) --- ollama-bridge: image: docker.io/alpine/socat:latest container_name: openclaw-ollama-bridge depends_on: - agent network_mode: "service:agent" command: TCP-LISTEN:11434,fork TCP:ollama:11434 stop_grace_period: 1s restart: always networks: net.ghost.openclaw: driver: bridge