This directory contains a Dockerfile for building a containerized version of rathole, a lightweight and secure reverse proxy.
- Environment Variable
mode
:
Set to eitherserver
orclient
to specify the operation mode. - Config File Mount:
Mount your
config.toml
to/rathole/config.toml
in the container using-v /path/to/config.toml:/rathole/config.toml
. - Port Mapping (Server Mode, Behind NAT):
map port2333
with-p 2333:2333
.
Run the Container in the Correct Docker Network To allow the Rathole container to communicate with other containers (for example, Jellyfin), make sure that all containers run in the same Docker network. This is necessary because Rathole uses container hostnames to route traffic between containers.
When configuring the server side, you must forward the ports so that you can access the services on the local system where the traffic is being tunneled. Otherwise, you will only be able to access the ports exposed inside the Rathole container itself, not the actual local services.
Start the Container
# Example: Run as server
docker run -e mode=server -p 2333:2333 -v /path/to/config.toml:/rathole/config.toml jaunger/rathole-test:stable
# Example: Run as client
docker run -e mode=client -v /path/to/config.toml:/rathole/config.toml jaunger/rathole-test:stable
version: "3.9"
services:
jellyfin:
image: jellyfin/jellyfin
ports:
- "8096:8096"
networks:
- internalnet
rathole:
image: jaunger/rathole-test:stable
environment:
- mode=client
ports:
- "2333:2333"
volumes:
- /config/config.toml:/rathole/config.toml
networks:
- internalnet
networks:
internalnet:
[client]
remote_addr = "server-ip:2333"
#default_token = "test"
[client.services.jellyfin]
token = "token"
local_addr = "jellyfin:8096
version: "3.9"
services:
rathole:
image: jaunger/rathole-test:stable
ports:
- "2333:2333"
- "8096:8096"
environment:
- mode=server
volumes:
- "/config/config.toml:/rathole/config.toml"
[server]
bind_addr = "0.0.0.0:2333"
#default_token = "test"
[server.services.jellyfin]
token = "token"
bind_addr = "0.0.0.0:8096"