From 713ca139c426e857e1eaa0271891e39672a204ed Mon Sep 17 00:00:00 2001 From: MechaCat02 Date: Sun, 31 May 2026 20:36:24 +0200 Subject: [PATCH] feat(deploy): add optional tor service to dev compose for native-backend dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirrors the prod tor service but with 127.0.0.1-only host port bindings so a `cargo run` on the host can reach 127.0.0.1:9050 / 9051. Default password baked in (overridable via TOR_CONTROL_PASSWORD env) since host-loopback is the only exposure surface — same friction-free posture as the postgres entry in this file. Co-Authored-By: Claude Opus 4.7 (1M context) --- docker-compose.dev.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 14e31d0..069c586 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -17,5 +17,28 @@ services: timeout: 5s retries: 10 + # Optional: TOR daemon for crawler dev. Ports bind to 127.0.0.1 only + # — never the LAN — so a native `cargo run` on the host can reach + # 127.0.0.1:9050 / 9051. Mirrors the prod tor service (see + # docker-compose.yml), just with host-loopback ports and a default + # password baked in for friction-free dev. + tor: + image: dockurr/tor:latest + entrypoint: ["/bin/sh", "/usr/local/bin/mangalord-entrypoint.sh"] + environment: + PASSWORD: ${TOR_CONTROL_PASSWORD:-dev-tor-password} + volumes: + - ./tor/torrc:/etc/tor/torrc:ro + - ./tor/entrypoint.sh:/usr/local/bin/mangalord-entrypoint.sh:ro + ports: + - "127.0.0.1:9050:9050" + - "127.0.0.1:9051:9051" + healthcheck: + test: ["CMD-SHELL", "nc -z 127.0.0.1 9050 && nc -z 127.0.0.1 9051"] + interval: 5s + timeout: 5s + retries: 20 + start_period: 30s + volumes: mangalord-postgres-dev: