VPN
For the VPN service, I use a glutun container to connect other containers to the VPN.
Documentation for gluetun can be found here.
In order for this to work properly, the ports from the containers using the VPN must be moved to the glutun config. The following option is added to the apps config file:
This will place the app container on the same docker network as the glutun container, and then all outbound traffic from the container will be sent out through the VPN.
I've created a stack called "VPN" and I will add all of the containers that use the VPN to this stack.
services:
### VPN SERVICE ###
gluetun:
image: qmcgaw/gluetun
container_name: gluetun
cap_add:
- NET_ADMIN
ports:
- 8888:8888/tcp
- 8388:8388
volumes:
- /var/lib/gluetun:/gluetun
environment:
- VPN_SERVICE_PROVIDER=mullvad
- VPN_TYPE=wireguard
- WIREGUARD_PRIVATE_KEY=provided by mullvad
- WIREGUARD_ADDRESSES=provided by mullvad
- SERVER_COUNTRIES=USA
- TZ=America/New_York
- UPDATER_PERIOD=24h
- UNBLOCK=usenetserver.com
- FIREWALL_OUTBOUND_SUBNETS=192.168.0.0/24
devices:
- /dev/net/tun:/dev/net/tun
restart: unless-stopped
networks: {}
The UNBLOCK=usenetserver.com is used to make sure that traffic from usenet is not blocked. Check the logs to make sure any sites being used are not blocked.