A Docker Tor proxy container to add to Docker Compose projects
 
 
Go to file
B.J. Dweck ba51a3147b Typo fix 2022-01-05 10:06:47 +02:00
Dockerfile Added existing project files 2022-01-05 09:32:46 +02:00
README.md Typo fix 2022-01-05 10:06:47 +02:00
svc-hostname Added existing project files 2022-01-05 09:32:46 +02:00
tor.sh Added existing project files 2022-01-05 09:32:46 +02:00

README.md

Tor Proxy

This is a Tor Proxy Docker container for "torifying" other Docker-based services in a Docker Compose project. It creates a Tor Hidden Service with an onion hostname that persists as long as it's underlying storage volume. The Tor Hidden Service listens on the specified port and proxies traffic to the specified target host:port.

Usage

Arguments

  • SVC_LISTEN_PORT: Port that the Tor hidden service will listen on for requests from the Tor network
  • SVC_TARGET_HOST: Target host for Tor traffic
  • SVC_TARGET_PORT: Target port on the target host

Sample docker-compose.yml

docker-compose.yml:

...

  mysvc_tor_proxy:
    build:
      context: ./tor-proxy
      args:
        - SVC_LISTEN_PORT=80
        - SVC_TARGET_HOST=mysvc
        - SVC_TARGET_PORT=8080
    volumes:
      - mysvc_config:/var/lib/tor
    depends_on:
      - mysvc
    restart: unless-stopped

...

Service Onion Hostname

You can get the onion hostname of the proxy using the following command:

user@host:~$ docker-compose exec mysvc_tor_proxy svc-hostname