version: "3.9" name: metal-kompanion networks: komnet: {} # runner ↔ tor ↔ ollama netpub: {} # egress to internet for tor + ollama services: tor: image: dperson/torproxy restart: unless-stopped command: -a 0.0.0.0 ports: ["127.0.0.1:9051:9051"] # optional host exposure networks: [komnet, netpub] ollama: image: ollama/ollama:latest restart: unless-stopped ports: ["127.0.0.1:11435:11435"] # expose to host for tools if desired volumes: - ollama:/root/.ollama # persist models once - /home/kompanion/ollama-modelfiles:/modelfiles # your custom Modelfiles/LoRA networks: [komnet, netpub] # can reach registry.ollama.ai runner: image: python:3.11-slim restart: unless-stopped working_dir: /app environment: XDG_STATE_HOME: /state XDG_CONFIG_HOME: /config XDG_CACHE_HOME: /cache ALL_PROXY: socks5h://tor:9051 NO_PROXY: ollama,localhost,127.0.0.1 OLLAMA_BASE: http://ollama:11435 # talk to container by DNS name depends_on: [ollama, tor] volumes: - /home/kompanion/.local/state/kompanion:/state/kompanion - /home/kompanion/.config/kompanion:/config/kompanion:ro - /home/kompanion/.cache/kompanion:/cache/kompanion - /home/kompanion/metal-kompanion-runtime:/app:ro command: ["python3","kom_runner.py"] networks: [komnet] volumes: ollama: {}