## Discord Plex FR : https://discord.gg/ERpYMqS
## Version 2021-06-06
##
##              NOTE : ATTENTION NE PAS BASCULER SUR L'IMAGE CRAZYMAX AVEC LES FICHIERS DE
##                           VOTRE ANCIENNE CONFIG LINUXSERVER/RUTORRENT
## Voir : https://blog.thelazyfox.xyz/docker-linuxserver-rutorrent-deprecated-what-i-have-done/
##

version: '3.2'
      
services: 
  vpn:
    image: dperson/openvpn-client:latest
    container_name: vpn
    restart: unless-stopped
    cap_add:
     - NET_ADMIN
    sysctls:
     - net.ipv6.conf.all.disable_ipv6=0
    security_opt:
     - label:disable
#    labels:
#     - com.centurylinklabs.watchtower.enable=true
    environment:
     - PUID=1000
     - PGID=100
     - TZ=Europe/Paris
    networks:
     - vpn-network
    dns:
     - 84.200.69.80
     - 8.8.8.8
     - 9.9.9.9
    ports :
     - 8080:8080 # WebUI rutorrent
     - 9117:9117 # WebUI jackett
     - 7878:7878 # WebUI radarr
     - 8989:8989 # WebUI sonarr
     - 8191:8191 #flaresolver
    devices:
     - /dev/net/tun:/dev/net/tun
    volumes:
     - /volume1/docker/vpn/config:/vpn
     - /volume1/docker/vpn/scripts:/scripts
    command: '-f "" -r 192.168.0.0/24'
    healthcheck:
      test: ["CMD", "curl", "-Ss", "ifconfig.co"]
      interval: 60s
      timeout: 15s
      
  sonarr:
    image: ghcr.io/linuxserver/sonarr
    container_name: sonarr
    network_mode: "service:vpn"
#    labels:
#      - com.centurylinklabs.watchtower.enable=true
    environment:
      - PUID=1000
      - PGID=100
      - TZ=Europe/Paris
    volumes:
      - /volume1/docker/sonarr/config:/config
      - /volume1/docker/rutorrent-vpn/downloads:/downloads
      - /volume1/Mes Séries:/tv
    restart: unless-stopped
    
  radarr:
    image: ghcr.io/linuxserver/radarr:nightly
    container_name: radarr
    network_mode: "service:vpn"
#    labels:
#      - com.centurylinklabs.watchtower.enable=true
    environment:
      - PUID=1000
      - PGID=100
      - TZ=Europe/Paris
    volumes:
      - /volume1/docker/radarr/config:/config
      - /volume1/docker/rutorrent-vpn/downloads:/downloads
      - /volume1/Mes Films:/movies
    restart: unless-stopped
      
    
  jackett:
    image: ghcr.io/linuxserver/jackett
    container_name: jackett
    network_mode: "service:vpn"
#    labels:
#      - com.centurylinklabs.watchtower.enable=true
    environment:
      - PUID=1000
      - PGID=100
      - TZ=Europe/Paris
    volumes:
      - /volume10/docker/jackett/config:/config
      - /volume10/docker/jackett/downloads:/downloads
    restart: unless-stopped
    
  flaresolverr:
    image: ghcr.io/flaresolverr/flaresolverr
    container_name: flaresolverr
    network_mode: "service:vpn"
#    labels:
#      - com.centurylinklabs.watchtower.enable=true
    environment:
      - LOG_LEVEL=info
    restart: unless-stopped
    
  rtorrent-rutorrent:
    image: crazymax/rtorrent-rutorrent:latest
    container_name: rutorrent-crazymax
#    labels:
#     - com.centurylinklabs.watchtower.enable=true
    depends_on:
      - vpn
    env_file:
      - "./rtorrent-rutorrent.env"
      - ".env"
    network_mode: "service:vpn"
    volumes:
      - "/volume1/docker/rutorrent/data:/data"
      - "/volume1/docker/rutorrent/passwd:/passwd"
      - "/volume1/docker/rutorrent/downloads:/downloads"
    ulimits:
      nproc: 65535
      nofile:
        soft: 32000
        hard: 40000
    restart: unless-stopped
    
  geoip-updater:
    image: crazymax/geoip-updater:latest
    container_name: geoip-rutorrent-crazymax
    network_mode: "service:vpn"
#    labels:
#     - com.centurylinklabs.watchtower.enable=true
    depends_on:
      - rtorrent-rutorrent
    volumes:
      - "/volume1/docker/rutorrent/data/geoip:/data"
    env_file:
      - "./geoip-updater.env"
    restart: unless-stopped
        
networks:
  vpn-network:
    external:
      name: vpn-network
