networks:
  traefik:
    external: true

services:
  transmission-openvpn:
    image: haugene/transmission-openvpn
    container_name: transmission
    networks:
      - traefik
    cap_add:
      - NET_ADMIN
    volumes:
      - /data/write/transmission/downloads:/data
      - './config:/config'
      - "/etc/localtime:/etc/localtime:ro"
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
      - OPENVPN_PROVIDER=NORDVPN
      - NORDVPN_CATEGORY=legacy_p2p
      - NORDVPN_COUNTRY=US
      - NORDVPN_PROTOCOL=tcp
      - OPENVPN_USERNAME=SERVICE_CREDENTIALS_USER
      - OPENVPN_PASSWORD=SERVICE_CREDENTIALS_PASS
      - LOCAL_NETWORK=172.0.0.0/8
      - OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60 --dhcp-option DNS 8.8.8.8
      - TRANSMISSION_RPC_USERNAME=UI_USER
      - TRANSMISSION_RPC_PASSWORD=UI_PASS
      - TRANSMISSION_RPC_AUTHENTICATION_REQUIRED=true
      - TRANSMISSION_WEB_UI=shift
    ports:
      - '9091:9091'
    labels:
      - traefik.http.routers.downloads.rule=Host(`TRAEFIK_URL`)
      - traefik.http.routers.downloads.tls=true
      - traefik.http.routers.downloads.tls.certresolver=lets-encrypt
      - traefik.http.services.downloads.loadbalancer.server.port=9091
      - traefik.port=9091

