version: "3.5"
services:
  vpn:
    image: ghcr.io/bubuntux/nordvpn # bubuntux/nordvpn:latest ?
    network_mode: bridge
    container_name: nordvpn
    cap_add:
      - NET_ADMIN    # Required
      - NET_RAW      # Required
    devices:
      - /dev/net/tun
    environment:                # Review https://github.com/bubuntux/nordvpn#environment-variables
      - USER=zino@onlinehome.de
      - PASS=zinomedial33t
      - CONNECT=cz149
      - NETWORK=192.168.1.0/24  # So it can be accessed within the local network
      - CYBER_SEC=Disable
      - FIREWALL=Disable
      - CHECK_CONNECTION_INTERVAL=60
      - TECHNOLOGY=OpenVPN
      - Protocol=UDP
    ports:  
      - 8112:8112 # deluge web gui
      - 6881:6881
      - 6881:6881/udp
      - 8088:8088 # qbittorrent web gui
  deluge:
    # zip files after completion:
    # Plugins -> Execute
    # Torrent complete -> /root/scripts/complete.pl
    image: customdeluge:latest
    container_name: deluge
    network_mode: service:vpn
    environment:
      - PUID=0
      - PGID=0
      - DELUGE_LOGLEVEL=error #optional
    volumes:
      - /home/zino/projects/dockers/deluge/config:/config
      - /home/zino/projects/dockers/deluge/downloads:/root/Downloads
      - /home/zino/projects/dockers/deluge/scripts:/root/scripts
      - /home/zino/projects/dockers/deluge/logs:/root/logs
      - /var/www/VST:/root/VST
    restart: unless-stopped
    depends_on:
      - vpn