190 lines
5.4 KiB
YAML
190 lines
5.4 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
|
|
- ./ollama/modelfiles:/etc/ollama/modelfiles:ro
|
|
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=${OLLAMA_FLASH_ATTENTION:-0}
|
|
- OLLAMA_KV_CACHE_TYPE=${OLLAMA_KV_CACHE_TYPE:-q8_0}
|
|
- OLLAMA_GPU_OVERHEAD=${OLLAMA_GPU_OVERHEAD:-4294967296}
|
|
- OLLAMA_MAX_LOADED_MODELS=${OLLAMA_MAX_LOADED_MODELS:-1}
|
|
- OLLAMA_NUM_PARALLEL=${OLLAMA_NUM_PARALLEL:-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) ---
|
|
openclaw:
|
|
#image: ghcr.io/openclaw/openclaw:latest
|
|
build:
|
|
context: ./openclaw
|
|
dockerfile: Containerfile
|
|
container_name: openclaw
|
|
user: "0:0"
|
|
environment:
|
|
- OPENCLAW_GATEWAY_MODE=local
|
|
- OPENCLAW_GATEWAY_PASSWORD=${OPENCLAW_PASSWORD}
|
|
- OPENCLAW_DEFAULT_MODEL=${OPENCLAW_DEFAULT_MODEL:-ollama/qwen3-general}
|
|
- OPENCLAW_CONFIG_PATH=/home/node/.openclaw/openclaw.json
|
|
- OPENCLAW_STATE_DIR=/home/node/.openclaw
|
|
- OLLAMA_URL=http://127.0.0.1:11434
|
|
- OLLAMA_API_KEY=ollama-local
|
|
- DOCKER_HOST=unix:///var/run/docker.sock
|
|
- OPENCLAW_SANDBOX_UIDSHIFT=${OPENCLAW_SANDBOX_UIDSHIFT}
|
|
- OPENCLAW_SANDBOX_HOST_WORKSPACE=${OPENCLAW_SANDBOX_HOST_WORKSPACE}
|
|
- OPENCLAW_SANDBOX_CONTAINER_WORKSPACE=${OPENCLAW_SANDBOX_CONTAINER_WORKSPACE}
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- ${HOST_OPENCLAW_JSON_PATH}:/home/node/.openclaw/openclaw.json${HOST_OPENCLAW_CONFIG_MOUNT_OPTS}
|
|
- ${HOST_WORKSPACE_PATH}:/home/node/.openclaw/workspace${HOST_OPENCLAW_WORKSPACE_MOUNT_OPTS}
|
|
- ${HOST_DOCKER_SOCKET_PATH}:/var/run/docker.sock${HOST_DOCKER_SOCKET_MOUNT_OPTS}
|
|
- ${HOST_REPOS_PATH}:/repos${HOST_REPOS_MOUNT_OPTS}
|
|
networks:
|
|
- net.ghost.openclaw
|
|
depends_on:
|
|
- ollama
|
|
- tool-router
|
|
|
|
|
|
|
|
# --- NETWORK TUNNEL (SIDECAR) ---
|
|
openclaw-ollama-bridge:
|
|
image: docker.io/alpine/socat:latest
|
|
container_name: openclaw-ollama-bridge
|
|
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:
|
|
build:
|
|
context: ./tools/router
|
|
dockerfile: Containerfile
|
|
container_name: tool-router
|
|
init: true
|
|
working_dir: /app
|
|
environment:
|
|
- PORT=3000
|
|
- LOG_LEVEL=debug
|
|
ports:
|
|
- "${TOOL_ROUTER_BIND:-127.0.0.1}:${TOOL_ROUTER_HOST_PORT:-3000}:3000"
|
|
expose:
|
|
- "3000"
|
|
dns:
|
|
- ${DNS_SERVER}
|
|
networks:
|
|
- net.ghost.openclaw
|
|
- net.ghost.tools
|
|
depends_on:
|
|
- tool-searchfetch
|
|
|
|
# --- SEARCHFETCH TOOL ---
|
|
tool-searchfetch:
|
|
build:
|
|
context: ./tools/searchfetch
|
|
dockerfile: Containerfile
|
|
container_name: tool-searchfetch
|
|
environment:
|
|
- SEARXNG_URL=http://tool-searchfetch-searxng:8080
|
|
networks:
|
|
- net.ghost.tools
|
|
depends_on:
|
|
- tool-searchfetch-searxng
|
|
healthcheck:
|
|
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
|
|
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
|
|
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${HOST_RW_MOUNT_OPTS}
|
|
networks:
|
|
- net.ghost.tools
|
|
|
|
tool-test:
|
|
image: docker.io/nikolaik/python-nodejs:python3.14-nodejs26-slim
|
|
container_name: tool-test
|
|
command: ["sh", "-c", "exec tail -f /dev/null"]
|
|
dns:
|
|
- ${DNS_SERVER}
|
|
networks:
|
|
- net.ghost.tools
|
|
|
|
networks:
|
|
net.ghost.openclaw:
|
|
name: net.ghost.openclaw
|
|
driver: bridge
|
|
internal: true
|
|
net.ghost.tools:
|
|
name: net.ghost.tools
|
|
driver: bridge
|