VPN

For the VPN service, I use a glutun container to connect other containers to the VPN.

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:

network_mode: "container:gluetun"

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:
  gluetun:
    image: qmcgaw/gluetun:v3
    container_name: gluetun
    cap_add:
      - NET_ADMIN
    ports:
      - 8888:8888/tcp
      - 8388:8388
    volumes:
      - /var/lib/gluetun:/gluetun
    environment: 
      - VPN_SERVICE_PROVIDER=nordvpn
      - VPN_TYPE=openvpn
      - OPENVPN_USER= #User Name provided by VPN Provider
      - OPENVPN_PASSWORD= #Password provided by VPN Provider
      - SERVER_COUNTRIES=United States
      - TZ=America/New_York
      - UPDATER_PERIOD=24h
      - UNBLOCK=usenetserver.com
    devices:
      - /dev/net/tun:/dev/net/tun
    restart: unless-stopped