services:
  # debian-xfce-firefox:
  #   container_name: debian-xfce-firefox
  #   image: repo.aknlw.com/akanealw/debian-vnc-xfce:latest-firefox-default
  #   environment:
  #     - PUID=${PUID}
  #     - PGID=${PGID}
  #   shm_size: '512m'
  #   depends_on:
  #     - gluetun
  #   network_mode: "service:gluetun"
  #   restart: always
  #   volumes:
  #     - debian-xfce-firefox:/home/akanealw

  firefox:
    container_name: firefox
    image: lscr.io/linuxserver/firefox:latest
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - START_DOCKER=false
      - LC_ALL=en_US.UTF-8
      - NO_DECOR=true
    depends_on:
      gluetun:
        condition: service_started
    network_mode: "service:gluetun"
    shm_size: "2gb"
    restart: always
    volumes:
      - ${DOCKER_CONFIGS}/firefox/config:/config

  gluetun:
    container_name: gluetun    
    image: qmcgaw/gluetun:v3.40.0
    environment:
      - VPN_SERVICE_PROVIDER=mullvad
      - VPN_TYPE=wireguard
      - WIREGUARD_PRIVATE_KEY=gCPJX6tLCWXYLjqGVpJCyOKfyTcLd/zlLBZoXAWH6Vk=
      - WIREGUARD_ADDRESSES=10.68.141.207/32
      - HTTPPROXY=on
      - SERVER_COUNTRIES=Canada,USA
      - TZ=${TZ}
      - BLOCK_MALICIOUS=off
      - BLOCK_SURVEILLANCE=off
      - BLOCK_ADS=off
      - UPDATER_PERIOD=24h
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    networks:
      - reverse-proxy
    ports:
      - 2525:1080 # socks5 proxy
      - 8777:8000 # http control
      - 9888:8888 # http proxy
      # - 6901:6901 # debian xfce firefox
      # - 3100:3000 # firefox http
      - 3101:3001 # firefox https
      - 3129:3129 # jdownloader
      - 5800:5800 # jdownloader
      - 8282:8282 # qbittorrent
      - 8181:8080 # sabnzbd
    restart: always
    volumes:
      - ${DOCKER_CONFIGS}/gluetun:/gluetun

  go-socks5-proxy:
    container_name: socks5
    image: serjs/go-socks5-proxy
    environment:
      - PROXY_USER=
      - PROXY_PASSWORD=
    depends_on:
      gluetun:
        condition: service_started
    network_mode: "service:gluetun"
    restart: always

  jdownloader:
    container_name: jdownloader
    image: jlesage/jdownloader-2:latest
    environment:
      - PGID=${PGID}
      - PUID=${PUID}
      - UMASK=${UMASK}
      - TZ=${TZ}
      - KEEP_APP_RUNNING=1
      - CLEAN_TMP_DIR=1
      - MYJD_USER=akanealw@gmail.com
      - MYJD_PASSWORD=trUKY4X8wzGiCr75ZmC9
      - MYJD_DEVICE_NAME=dockerserver
      - XDG_DOWNLOAD_DIR=/output
    depends_on:
      gluetun:
        condition: service_started
    network_mode: "service:gluetun"
    restart: always
    volumes:
      - ${DOCKER_CONFIGS}/jdownloader:/config
      - ${MEDIA_DIR}/downloads/jdownloader:/output
      - /etc/localtime:/etc/localtime:ro

  qbittorrent:
    container_name: qbittorrent
    image: lscr.io/linuxserver/qbittorrent:latest
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - WEBUI_PORT=8282
    depends_on:
      gluetun:
        condition: service_started
    network_mode: "service:gluetun"
    restart: always
    volumes:
      - ${DOCKER_CONFIGS}/qbittorrent/config:/config
      - ${MEDIA_DIR}:/media
      - ${MEDIA_DIR}/downloads/torrents:/torrents

  sabnzbd:
    container_name: sabnzbd
    image: lscr.io/linuxserver/sabnzbd:latest
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    depends_on:
      gluetun:
        condition: service_started
    network_mode: "service:gluetun"
    restart: always
    volumes:
      - ${DOCKER_CONFIGS}/sabnzbd:/config
      - ${MEDIA_DIR}:/media
      - ${MEDIA_DIR}/downloads/nzbs:/nzbs    

networks:
  reverse-proxy:
    name: reverse-proxy
    external: true

# volumes:
#   debian-xfce-firefox:
