services:
wg:
image: ghcr.io/raylas/wg-peer:latest # Dead image, sorry
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
net.ipv4.conf.all.src_valid_mark: 1
network_mode: bridge
ports:
- 9091:9091
environment:
INTERFACE: wg0
volumes:
- ./wg0.conf:/etc/wireguard/wg0.conf
transmission:
image: linuxserver/transmission:latest
network_mode: "service:wg"
Key bits:
- Tunnel service uses
network_mode: bridge
- Tunneled services use
network_mode: "service:wg"
In this case, the transmission
service will use the wg
service as its default gateway. Whereas the wg
service will route its internet-bound traffic via the local host's bridge network.
Port forwarding for transmission
is configured on the wg
service for local access.