networks:
  media-net:
    driver: bridge
  ix-databases_shared-databases:
    external: true
  pangolin:
    external: true

services:

  plex:
    container_name: ix-plex-plex-1
    image: lscr.io/linuxserver/plex:latest
    restart: unless-stopped
    networks:
      - media-net
      - pangolin
    ports:
      - "32400:32400/tcp"
      - "1900:1900/udp"
      - "8324:8324/tcp"
      - "32410:32410/udp"
      - "32412:32412/udp"
      - "32413:32413/udp"
      - "32414:32414/udp"
      - "32469:32469/tcp"
    environment:
      TZ: ${TZ}
      PUID: ${PUID}
      PGID: ${PGID}
      VERSION: docker
      NVIDIA_VISIBLE_DEVICES: all
      NVIDIA_DRIVER_CAPABILITIES: compute,video,utility
    volumes:
      - /mnt/docker-ssd/docker/appdata/plex:/config
      - /mnt/unraid/data/media/anime:/anime
      - /mnt/unraid/data/media/movies:/movies
      - /mnt/unraid/data/media/tv:/tv
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu, video, compute]

  tautulli:
    container_name: ix-tautulli-tautulli-1
    image: ghcr.io/tautulli/tautulli:latest
    restart: unless-stopped
    networks:
      - media-net
      - pangolin
    ports:
      - "8181:8181"
    environment:
      TZ: ${TZ}
      PUID: ${PUID}
      PGID: ${PGID}
    volumes:
      - /mnt/docker-ssd/docker/appdata/tautulli:/config
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://127.0.0.1:8181/ || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s

  audiobookshelf:
    container_name: ix-audiobookshelf-audiobookshelf-1
    image: ghcr.io/advplyr/audiobookshelf:latest
    restart: unless-stopped
    networks:
      - media-net
      - pangolin
    ports:
      - "13358:80"
    environment:
      TZ: ${TZ}
    volumes:
      - /mnt/unraid/data/media/books/Audiobooks:/audiobooks
      - /mnt/docker-ssd/docker/appdata/audiobookshelf/config:/config
      - /mnt/docker-ssd/docker/appdata/audiobookshelf/metadata:/metadata
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:80/ >/dev/null 2>&1 || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s

  seerr:
    container_name: seerr
    image: ghcr.io/seerr-team/seerr:latest
    restart: unless-stopped
    networks:
      - media-net
      - ix-databases_shared-databases
      - pangolin
    ports:
      - "5055:5055"
    environment:
      TZ: ${TZ}
      DB_TYPE: postgres
      DB_HOST: shared-postgres
      DB_PORT: 5432
      DB_NAME: ${SEERR_DB_NAME}
      DB_USER: ${SEERR_DB_USER}
      DB_PASS: ${SEERR_DB_PASS}
      LOG_LEVEL: info
    volumes:
      - /mnt/docker-ssd/docker/appdata/seerr:/app/config
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:5055/ >/dev/null 2>&1 || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s

  calibre-web-automated:
    container_name: calibre-web-automated
    image: crocodilestick/calibre-web-automated:latest
    restart: unless-stopped
    networks:
      - media-net
      - pangolin
    ports:
      - "8183:8083"
    environment:
      TZ: ${TZ}
      PUID: ${CWA_PUID}
      PGID: ${CWA_PGID}
    volumes:
      - /mnt/tank/docker/appdata/autocalibreweb-clean/config:/config
      - /mnt/unraid/data/media/books/ingest:/cwa-book-ingest
      - /mnt/unraid/data/media/books/Calibre:/calibre-library
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://127.0.0.1:8083/ >/dev/null 2>&1 || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
