Files
ghostnet-openclaw/compose.amd.yaml
T

157 lines
4.1 KiB
YAML

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
- /dev/kfd:/dev/kfd:rwm
group_add:
- 44
- 109
rendersecurity_opt:
- label=disable
volumes:
- ./storage/ollama_models:/root/.ollama
environment:
- OLLAMA_HOST=0.0.0.0:11434
- MODEL_LIST=${MODEL_LIST}
- OLLAMA_KEEP_ALIVE=${OLLAMA_KEEP_ALIVE}
- HSA_OVERRIDE_GFX_VERSION=11.0.0
- 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
# --- TOOL ROUTER (GATEWAY) ---
tool-router:
image: docker.io/python:3.12-slim
container_name: tool-router
depends_on:
- tool-searchfetch
init: true
working_dir: /app
environment:
- PORT=3000
command: >
sh -c "pip install --no-cache-dir fastapi uvicorn 'modelcontextprotocol[python-sdk]' &&
uvicorn router:app --host 0.0.0.0 --port 3000"
volumes:
- ./tools/router/src/router.py:/app/router.py:ro,Z
- ./tools/router/config:/app/config:ro,Z
expose:
- "3000"
dns:
- ${DNS_SERVER}
networks:
- net.ghost.openclaw
- net.ghost.tools
# --- SEARCHFETCH TOOL ---
tool-searchfetch:
image: docker.io/nikolaik/python-nodejs:python3.14-nodejs26-slim
container_name: tool-searchfetch
depends_on:
- tool-searchfetch-searxng
networks:
- net.ghost.tools
environment:
- SEARXNG_URL=http://tool-searchfetch-searxng:8080
- MCP_HOST=0.0.0.0
- MCP_PORT=3000
command: >
sh -c "pip install --no-cache-dir mcp-proxy &&
npm install -g mcp-searxng &&
mcp-proxy --host $$MCP_HOST --port $$MCP_PORT --pass-environment -- mcp-searxng"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:$$MCP_PORT/sse"]
interval: 30s
timeout: 10s
retries: 3
# --- SEARXNG SERVICE FOR SEARCHFETCH TOOL ---
tool-searchfetch-searxng:
image: docker.io/searxng/searxng:latest
container_name: tool-searchfetch-searxng
depends_on:
- tool-searchfetch-valkey
restart: always
volumes:
- ./tools/searchfetch/config/searxng.settings.yml:/etc/searxng/settings.yml:ro,Z
- ./storage/searxng:/tmp:Z
environment:
- SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml
- SEARXNG_VALKEY_URL=redis://tool-searchfetch-valkey:6379/0
expose:
- "8080"
dns:
- ${DNS_SERVER}
networks:
- net.ghost.tools
tool-searchfetch-valkey:
image: docker.io/valkey/valkey:8-alpine
container_name: tool-searchfetch-valkey
restart: always
volumes:
- ./storage/searxng_valkey:/data:U,Z
networks:
- net.ghost.tools
tool-test:
image: docker.io/nikolaik/python-nodejs:python3.14-nodejs26-slim
container_name: tool-test
command: ["sh", "-c", "while true; do sleep 1000; done"]
dns:
- ${DNS_SERVER}
networks:
- net.ghost.tools
networks:
net.ghost.openclaw:
driver: bridge
internal: true
net.ghost.tools:
driver: bridge