services:
  gluetun:
    image: qmcgaw/gluetun:latest
    container_name: gluetun
    # line above must be uncommented to allow external containers to connect. See https://github.com/qdm12/gluetun/wiki/Connect-a-container-to-gluetun#external-container-to-gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - 8888:8888/tcp # HTTP proxy
      - 8388:8388/tcp # Shadowsocks
      - 8388:8388/udp # Shadowsocks
      - 8080:8080/tcp # sabnzbd webUI
    volumes:
      - gluetun_data:/gluetun
    environment:
      # See https://github.com/qdm12/gluetun/wiki
      - VPN_SERVICE_PROVIDER=airvpn
      - VPN_TYPE=wireguard
      - WIREGUARD_PRIVATE_KEY=${WIREGUARD_PRIVATE_KEY}
      - WIREGUARD_PRESHARED_KEY=${WIREGUARD_PRESHARED_KEY}
      - WIREGUARD_ADDRESSES=${WIREGUARD_ADDRESSES}
      - UPDATER_PERIOD:24h
      - TZ=America/New_York # Timezone for accurate log times
      - SERVER_COUNTRIES=United States
    restart: always
    labels:
      - diun.enable=true
  sabnzbd:
    image: lscr.io/linuxserver/sabnzbd:latest
    container_name: sabnzbd
    environment:
      - PUID=1000
      - PGID=1000
      - UMASK=022
      - TZ=America/New_York
    volumes:
      - sabnzbd_data:/config
      - /data/usenet/downloads:/downloads
      - /data/usenet/incomplete-downloads:/incomplete-downloads
    # network_mode: "service:gluetun" forces sabnzbd to connect to the internet through the VPN defined in the gluetun container above
    network_mode: service:gluetun
    depends_on:
      gluetun:
        condition: service_healthy
    restart: always
    labels:
      - diun.enable=true
  sonarr:
    image: lscr.io/linuxserver/sonarr:latest
    container_name: sonarr
    environment:
      - PUID=1000
      - PGID=1000
      - UMASK=022
      - TZ=America/New_York
    volumes:
      - /docker/config/sonarr:/config
      - /mnt/share/media/tv:/tv
      - /mnt/share/media/anime:/anime
      - /mnt/share/media/babies:/babies
      - /data/usenet/downloads:/downloads
    ports:
      - 8989:8989
    restart: always
    labels:
      - diun.enable=true
  radarr:
    image: lscr.io/linuxserver/radarr:latest
    container_name: radarr
    environment:
      - PUID=1000
      - PGID=1000
      - UMASK=022
      - TZ=America/New_York
    volumes:
      - /docker/config/radarr:/config
      - /mnt/share/media:/data
      - /mnt/share/media/movies:/movies
      - /mnt/share/media/movies_kids:/movies_kids
      - /data/usenet/downloads:/downloads
    ports:
      - 7878:7878
    restart: always
  prowlarr:
    image: lscr.io/linuxserver/prowlarr:latest
    container_name: prowlarr
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
    volumes:
      - /docker/config/prowlarr:/config
    ports:
      - 9696:9696
    restart: always
    labels:
      - diun.enable=true
  jellyseerr:
    image: fallenbagel/jellyseerr:latest
    container_name: jellyseerr
    environment:
      - LOG_LEVEL=debug
      - TZ=America/New_York
    ports:
      - 5055:5055
    volumes:
      - /docker/config/jellyseerr/:/app/config
    restart: unless-stopped
    labels:
      - diun.enable=true
  tautulli:
    image: lscr.io/linuxserver/tautulli:latest
    container_name: tautulli
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
    volumes:
      - tautulli:/config
    ports:
      - 8181:8181
    restart: always
    labels:
      - diun.enable=true
  audiobookshelf:
    image: ghcr.io/advplyr/audiobookshelf:latest
    container_name: audiobookshelf
    ports:
      - 13378:80
    volumes:
      - /mnt/share/media/audiobooks:/audiobooks
      - /mnt/share/media/books:/books
      - /mnt/share/media/podcasts:/podcasts
      - /docker/config/audiobookshelf:/config
      - ./audiobookshelf/metadata:/metadata
    environment:
      - TZ=America/New_York
    restart: always
    labels:
      - diun.enable=true
  huntarr:
    image: huntarr/huntarr:latest
    container_name: huntarr
    restart: always
    ports:
      - 9705:9705
    volumes:
      - huntarr_data:/config
    environment:
      - TZ=America/New_York
    labels:
      - diun.enable=true
  jellystat-db:
    image: postgres:15.2
    shm_size: 1gb
    container_name: jellystat-db
    restart: unless-stopped
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: 10m
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: ${JELLYSTAT_POSTGRES_PASSWORD}
    labels:
      - diun.enable=true
    volumes:
      - postgres_data:/var/lib/postgresql/data
  jellystat:
    image: cyfershepard/jellystat:latest
    container_name: jellystat
    restart: unless-stopped
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: 10m
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: ${JELLYSTAT_POSTGRES_PASSWORD}
      POSTGRES_IP: jellystat-db
      POSTGRES_PORT: 5432
      JWT_SECRET: ${JELLYSTAT_JWT_SECRET}
      TZ: America/New_York
    labels:
      - diun.enable=true
    volumes:
      - jellystat-backup-data:/app/backend/backup-data
    ports:
      - 3200:3000
    depends_on:
      - jellystat-db
networks:
  default: null
volumes:
  gluetun_data: null
  sabnzbd_data: null
  tautulli: null
  huntarr_data: null
  postgres_data: null
  jellystat-backup-data: null
