Optimized toolchain configuration. Rewrite of tool-router.

This commit is contained in:
2026-06-05 02:07:24 +02:00
parent d6df397c17
commit b16f4754b0
21 changed files with 570 additions and 173 deletions
+45 -34
View File
@@ -25,19 +25,33 @@ services:
- OLLAMA_KEEP_ALIVE=${OLLAMA_KEEP_ALIVE}
- HSA_OVERRIDE_GFX_VERSION=11.0.0
- OLLAMA_FLASH_ATTENTION=1
- http_proxy=http://ollama-proxy:3128
- https_proxy=http://ollama-proxy:3128
- no_proxy=localhost,127.0.0.1,0.0.0.0,ollama,openclaw-agent,tool-router,openclaw-ollama-bridge
ports:
- "11434:11434"
dns:
- ${DNS_SERVER}
networks:
- net.ghost.openclaw
depends_on:
- ollama-proxy
ollama-proxy:
image: docker.io/ubuntu/squid
container_name: ollama-proxy
volumes:
- ./ollama/proxy/squid.conf:/etc/squid/squid.conf:Z
networks:
- net.ghost.openclaw # Erreichbar für Ollama
- net.ghost.tools # Hat Internetzugriff für Registry-Pulls
restart: unless-stopped
stop_grace_period: 3s
# --- CORE AGENT (GATEWAY) ---
agent:
openclaw:
image: ghcr.io/openclaw/openclaw:latest
container_name: openclaw-agent
depends_on:
- ollama
container_name: openclaw
userns_mode: "keep-id"
environment:
- OPENCLAW_GATEWAY_MODE=local
@@ -52,34 +66,32 @@ services:
- ${HOST_REPOS_PATH}:/repos:Z,U
networks:
- net.ghost.openclaw
depends_on:
- ollama
- tool-router
# --- NETWORK TUNNEL (SIDECAR) ---
ollama-bridge:
image: docker.io/alpine/socat:latest
container_name: openclaw-ollama-bridge
depends_on:
- agent
network_mode: "service:agent"
network_mode: "service:openclaw"
command: TCP-LISTEN:11434,fork TCP:ollama:11434
stop_grace_period: 1s
restart: always
depends_on:
- openclaw
# --- TOOL ROUTER (GATEWAY) ---
tool-router:
image: docker.io/python:3.12-slim
build:
context: ./tools/router
dockerfile: Containerfile
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
- LOG_LEVEL=debug
expose:
- "3000"
dns:
@@ -87,35 +99,31 @@ services:
networks:
- net.ghost.openclaw
- net.ghost.tools
depends_on:
- tool-searchfetch
# --- SEARCHFETCH TOOL ---
tool-searchfetch:
image: docker.io/nikolaik/python-nodejs:python3.14-nodejs26-slim
build:
context: ./tools/searchfetch
dockerfile: Containerfile
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"
networks:
- net.ghost.tools
depends_on:
- tool-searchfetch-searxng
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:$$MCP_PORT/sse"]
interval: 30s
timeout: 10s
test: ["CMD-SHELL", "timeout 2s nc -z localhost 3000 || exit 1"]
interval: 10s
timeout: 5s
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
@@ -129,20 +137,23 @@ services:
- ${DNS_SERVER}
networks:
- net.ghost.tools
depends_on:
- tool-searchfetch-valkey
tool-searchfetch-valkey:
image: docker.io/valkey/valkey:8-alpine
container_name: tool-searchfetch-valkey
restart: always
user: "1000:1000"
volumes:
- ./storage/searxng_valkey:/data:U,Z
- ./storage/searxng_valkey:/data:Z,U
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"]
command: ["sh", "-c", "exec tail -f /dev/null"]
dns:
- ${DNS_SERVER}
networks: