From 628e7b529eadbac1189a686a56cecafb154a0c51 Mon Sep 17 00:00:00 2001
From: esus <esus@esus.name>
Date: Mon, 13 Oct 2025 04:32:19 +1300
Subject: [PATCH] Use host tor and ollama for now

Later for publishing we can offer both variants.
---
 docker/compose.host.yml     | 12 ++++++------
 docker/compose.override.yml | 12 ------------
 docker/compose.yml          | 34 ++++++----------------------------
 3 files changed, 12 insertions(+), 46 deletions(-)
 delete mode 100644 docker/compose.override.yml

diff --git a/docker/compose.host.yml b/docker/compose.host.yml
index 1f95fc4..0f0e390 100644
--- a/docker/compose.host.yml
+++ b/docker/compose.host.yml
@@ -1,24 +1,24 @@
 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
-      # Route egress through host TOR by default
-      ALL_PROXY: socks5h://host.docker.internal:9051
-      NO_PROXY: localhost,127.0.0.1,host.docker.internal
-      # Talk to HOST ollama on 11435
+      # talk to host services:
       OLLAMA_BASE: http://host.docker.internal:11435
+      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"]
-    extra_hosts:
-      - "host.docker.internal:host-gateway"
+
diff --git a/docker/compose.override.yml b/docker/compose.override.yml
deleted file mode 100644
index 2da2f6f..0000000
--- a/docker/compose.override.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-version: "3.9"
-services:
-  ollama:
-    networks: [komnet]
-    volumes:
-      - /home/kompanion/ollama:/root/.ollama
-  runner:
-    environment:
-      OLLAMA_BASE_URL: http://ollama:11434
-networks:
-  komnet:
-    internal: false
diff --git a/docker/compose.yml b/docker/compose.yml
index bd41bdf..e5dd394 100644
--- a/docker/compose.yml
+++ b/docker/compose.yml
@@ -1,46 +1,24 @@
 version: "3.9"
-name: metal-kompanion
-
-networks:
-  komnet: {}   # runner ↔ tor ↔ ollama
-  netpub: {}   # egress to internet for tor + ollama
+name: metal-kompanion-host
 
 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
+    extra_hosts: ["host.docker.internal:host-gateway"]
     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]
+      # 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"]
-    networks: [komnet]
 
-volumes:
-  ollama: {}
