Readd a self contained compose dockerfile

This commit is contained in:
Χγφτ Kompanion 2025-10-13 04:57:08 +13:00
parent 628e7b529e
commit 3ae8bebb54
2 changed files with 44 additions and 24 deletions

View File

@ -0,0 +1,44 @@
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
networks: [komnet, netpub]
ollama:
image: ollama/ollama:latest
restart: unless-stopped
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:9050
NO_PROXY: ollama,localhost,127.0.0.1
OLLAMA_BASE: http://ollama:11434 # 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: {}

View File

@ -1,24 +0,0 @@
version: "3.9"
name: metal-kompanion-host
services:
runner:
image: python:3.11-slim
restart: unless-stopped
working_dir: /app
extra_hosts: ["host.docker.internal:host-gateway"]
environment:
XDG_STATE_HOME: /state
XDG_CONFIG_HOME: /config
XDG_CACHE_HOME: /cache
# talk to host services:
OLLAMA_BASE: http://host.docker.internal:11434
ALL_PROXY: socks5h://host.docker.internal:9050
NO_PROXY: host.docker.internal,127.0.0.1,localhost
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"]