This document provides instructions for running Reverse-SOXY in Docker containers.
- Docker
- Docker Compose (optional, for running multi-container setups)
To build the Docker image:
docker build -t reverse-soxy .docker run -p 1080:1080 -p 9000:9000 reverse-soxy --proxy-listen-addr 0.0.0.0:1080 --tunnel-listen-port 9000 --secret yourSecretHeredocker run reverse-soxy --tunnel-addr proxy.host:9000 --secret yourSecretHeredocker run -p 9000:9000 reverse-soxy --mode relay --relay-listen-port 9000 --secret yourSecretHeredocker run -p 1080:1080 reverse-soxy --mode proxy --register --relay-addr relay.host:9000 --proxy-listen-addr 0.0.0.0:1080 --secret yourSecretHeredocker run reverse-soxy --mode agent --relay-addr relay.host:9000 --secret yourSecretHereThe included docker-compose.yml file provides configurations for all modes of operation.
Before running, set a secure secret:
export SECRET=yourSecretHere# Start the proxy
docker-compose up proxy
# In another terminal, start the agent
docker-compose up agent# Start the relay server
docker-compose up relay
# In another terminal, start the proxy via relay
docker-compose up proxy-via-relay
# In another terminal, start the agent via relay
docker-compose up agent-via-relaySECRET: The shared secret for encryption/authenticationPROXY_HOST: The hostname of the proxy (for agent mode)RELAY_HOST: The hostname of the relay server (for proxy-via-relay and agent-via-relay modes)
You can mount a custom YAML configuration file:
docker run -v /path/to/your/config.yml:/app/config/config.yml reverse-soxy --config /app/config/config.yml --secret yourSecretHere- Always use a strong, unique secret for each deployment
- Consider using Docker secrets or environment variables for the secret in production
- The default configuration exposes ports to all interfaces (0.0.0.0) within the container, so be careful with port mappings
- In production, consider using a non-root user in the container
Add the --debug flag to enable debug logging:
docker run reverse-soxy --secret yourSecretHere --debugdocker logs <container_id>docker exec -it <container_id> /bin/sh