# gluetun - https://github.com/qdm12/gluetun-wiki/blob/main/setup/providers/surfshark.md
---
version: "3.8"
services:
  gluetun:
    container_name: gluetun
    image: qmcgaw/gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    environment:
      - VPN_SERVICE_PROVIDER=${VPN_SERVICE_PROVIDER}
      - VPN_TYPE=${VPN_TYPE}
      - WIREGUARD_PRIVATE_KEY=${WIREGUARD_PRIVATE_KEY}
      - WIREGUARD_ADDRESSES=${WIREGUARD_ADDRESSES}
      - SERVER_COUNTRIES=${SERVER_COUNTRIES}
      - FIREWALL_OUTBOUND_SUBNETS=${FIREWALL_OUTBOUND_SUBNETS}    
    ports:
      - '${CHROMIUM_HTTP}'
      - '${CHROMIUM_HTTPS}'
      - '${TORRENT_WEBUI_PORT}'
      - '${TORRENT_INCOMMING_PORT}'
      - '${TORRENT_INCOMMING_PORT_UDP}'
      - '${NICOTINE_PORTS}'  
      - '${NICOTINE_INCOMMING}'
    restart: unless-stopped
    labels:
      # Nicotine Automation
      - "npm.proxy.domains=nicotine"
      - "npm.proxy.port=${NICOTINE_UI_PORT}"
      - "npm.proxy.scheme=http"
      - "npm.proxy.websockets=true"
      - "pihole.custom-record=[[\"nicotine\", \"${DOCKER_HOST_IP}\"]]"
      # Torrent Automation
      - "npm.proxy.1.domains=torrent"
      - "npm.proxy.1.port=${TORRENT_UI_PORT}"
      - "npm.proxy.1.scheme=http"
      - "npm.proxy.1.websockets=true"
      - "pihole.custom-record.1=[[\"torrent\", \"${DOCKER_HOST_IP}\"]]"

# for external containers use `network_mode: "container:gluetun"`