services:
  jellyfin:
    image: jellyfin/jellyfin
    user: 112:120
    group_add: # by id as these may not exist within the container. Needed to provide permissions to the VAAPI Devices
      - '106' #render
      - '44' #video
    network_mode: 'host'
    restart: 'unless-stopped'
    devices:
      # VAAPI Devices
      - /dev/dri/renderD128:/dev/dri/renderD128
      - /dev/dri/card0:/dev/dri/card0
    environment:
      - JELLYFIN_CACHE_DIR=/var/cache/jellyfin
      - JELLYFIN_CONFIG_DIR=/etc/jellyfin
      - JELLYFIN_DATA_DIR=/var/lib/jellyfin
      - JELLYFIN_LOG_DIR=/var/log/jellyfin
      - TZ=America/Santo_Domingo
    volumes:
      - /etc/jellyfin:/etc/jellyfin
      - /var/cache/jellyfin:/var/cache/jellyfin
      - /var/lib/jellyfin:/var/lib/jellyfin
      - /var/log/jellyfin:/var/log/jellyfin
      - /media/HDD1/Anime:/media/HDD1/Anime
      - /media/HDD1/Animovies:/media/HDD1/Animovies
      - /media/HDD1/Movies:/media/HDD1/Movies
      - /media/HDD1/Movies-Kids:/media/HDD1/Movies-Kids
      - /media/HDD1/TV:/media/HDD1/TV
      - /media/HDD1/TV-Kids:/media/HDD1/TV-Kids
      - /media/HDD1/Torrents:/media/HDD1/Torrents
      - /media/HDD2/Anime:/media/HDD2/Anime
      - /media/HDD2/Animovies:/media/HDD2/Animovies
      - /media/HDD2/Movies:/media/HDD2/Movies
      - /media/HDD2/Movies-Kids:/media/HDD2/Movies-Kids
      - /media/HDD2/TV:/media/HDD2/TV
      - /media/HDD2/TV-Kids:/media/HDD2/TV-Kids
      - /media/HDD2/Torrents:/media/HDD2/Torrents
      - /media/HDD3/Anime:/media/HDD3/Anime
      - /media/HDD3/Animovies:/media/HDD3/Animovies
      - /media/HDD3/Movies:/media/HDD3/Movies
      - /media/HDD3/Movies-Kids:/media/HDD3/Movies-Kids
      - /media/HDD3/TV:/media/HDD3/TV
      - /media/HDD3/TV-Kids:/media/HDD3/TV-Kids
      - /media/HDD3/Torrents:/media/HDD3/Torrents
      - /media/HDD1/prerolls:/media/HDD1/prerolls
  qbittorrent-nox:
    # for debugging
    #cap_add:
      #- SYS_PTRACE
    container_name: qbittorrent-nox
    environment:
      #- PAGID=10000
      #- PGID=1000
      #- PUID=1000
      - QBT_EULA=accept
      - QBT_VERSION=latest
      - QBT_WEBUI_PORT=8080
      #- TZ=UTC
      #- UMASK=022
    image: qbittorrentofficial/qbittorrent-nox:latest
    ports:
      # for bittorrent traffic
      - 6881:6881/tcp
      - 6881:6881/udp
      # for WebUI
      - 8080:8080/tcp
    read_only: true
    stop_grace_period: 30m
    tmpfs:
      - /tmp
    tty: true
    volumes:
      - /home/peter/docker:/config
      - /media/HDD3/torrents:/downloads
      - /home/peter/VueTorrent:/VueTorrent
  jackett:
    image: lscr.io/linuxserver/jackett:latest
    container_name: jackett
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - AUTO_UPDATE=true #optional
      - RUN_OPTS= #optional

    volumes:
      - /home/peter/docker:/config
      - /media/Torrents:/downloads
    ports:
      - 9117:9117

    restart: always
    
  flaresolverr:
    # DockerHub mirror flaresolverr/flaresolverr:latest
    image: alexfozor/flaresolverr:pr-1300-experimental
    container_name: flaresolverr
    environment:
      - LOG_LEVEL=${LOG_LEVEL:-info}
      - LOG_HTML=${LOG_HTML:-false}
      - CAPTCHA_SOLVER=${CAPTCHA_SOLVER:-none}
      - TZ=America/Santo_Domingo
    ports:
      - "${PORT:-8191}:8191"
    restart: unless-stopped
  dockerproxy:
    image: ghcr.io/tecnativa/docker-socket-proxy:latest
    container_name: dockerproxy
    environment:
      - CONTAINERS=1 # Allow access to viewing containers
      - SERVICES=1 # Allow access to viewing services (necessary when using Docker Swarm)
      - TASKS=1 # Allow access to viewing tasks (necessary when using Docker Swarm)
      - POST=0 # Disallow any POST operations (effectively read-only)
    ports:
      - 2375:2375
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro # Mounted as read-only
    restart: unless-stopped
