---
services:
  bazarr:
    image: ghcr.io/linuxserver/bazarr@sha256:f25f8d61c5d3d5b963e92cfb6d53930648e995fbd22ff62d3cd8b061282f59c7
    container_name: bazarr
    ports:
      - "6767:6767"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /docker/appdata/bazarr:/config
      - nas:/data/media
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
    security_opt:
      - apparmor:unconfined

  lidarr:
    image: ghcr.io/linuxserver/lidarr@sha256:f6cfa621faf759bd7936473a28a05671f23ab3246ca932341ee5a20a887143ca
    container_name: lidarr
    ports:
      - "8686:8686"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /docker/appdata/lidarr:/config
      - /data:/data
      - nas:/data/media
      - /docker/appdata/lidarr-extended:/custom-services.d
      - /docker/appdata/lidarr-extended1:/custom-cont-init.d
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
    security_opt:
      - apparmor:unconfined

  prowlarr:
    image: ghcr.io/linuxserver/prowlarr@sha256:b242bc98897d8fa65db7b72f5dbde04b161a092d3cce2321b8c7e62c9321820d
    container_name: prowlarr
    ports:
      - "9696:9696"
    volumes:
      - /docker/appdata/prowlarr:/config
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000

  radarr:
    image: ghcr.io/linuxserver/radarr@sha256:b2d2bc9bafb76073d96142bda07ea90c6d6afd9207fe4ff2d4f9d3b50fcdbd76
    container_name: radarr
    ports:
      - "7878:7878"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /docker/appdata/radarr:/config
      - /data:/data
      - nas:/data/media
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
    security_opt:
      - apparmor:unconfined

  sonarr:
    image: ghcr.io/linuxserver/sonarr@sha256:28d9dcbc846aed74bd47dc90305e016183443ddc3dfa3e8bcac268fc653a6e5e
    container_name: sonarr
    ports:
      - "8989:8989"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /docker/appdata/sonarr:/config
      - /data:/data
      - nas:/data/media
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
    security_opt:
      - apparmor:unconfined

  homarr:
    container_name: homarr
    image: ghcr.io/ajnart/homarr:0.15.10
    restart: unless-stopped
    volumes:
      - /docker/appdata/homarr/configs:/app/data/configs
      - /docker/appdata/homarr/icons:/app/public/icons
      - /docker/appdata/homarr/data:/data
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - '7575:7575'
    environment:
      - AUTH_PROVIDER=oidc
      - AUTH_OIDC_URI=${AUTH_OIDC_URI}
      - AUTH_OIDC_CLIENT_SECRET=${AUTH_OIDC_CLIENT_SECRET}
      - AUTH_OIDC_CLIENT_ID=${AUTH_OIDC_CLIENT_ID}
      - AUTH_OIDC_CLIENT_NAME=authentik
      - BASE_URL=${BASE_URL}
      - NEXTAUTH_URL=${NEXTAUTH_URL}
      - AUTH_OIDC_ADMIN_GROUP=${AUTH_OIDC_ADMIN_GROUP}


  doplarr:
    image: ghcr.io/linuxserver/doplarr@sha256:5ce71fe72864d58193120e80c0b334d82d343df8b51be8b511bb969cf3e7a174
    container_name: doplarr
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=${TZ}
      - DISCORD__TOKEN=${DISCORD__TOKEN}
      - RADARR__API=${RADARR__API}
      - RADARR__URL=${RADARR__URL}
      - SONARR__API=${SONARR__API}
      - SONARR__URL=${SONARR__URL}
      - DISCORD__MAX_RESULTS=25
      - DISCORD__REQUESTED_MSG_STYLE=plain
      - SONARR__QUALITY_PROFILE=WEB-DL (1080p)
      - RADARR__QUALITY_PROFILE=Requests
      - SONARR__ROOTFOLDER=/data/media/TV
      - RADARR__ROOTFOLDER=/data/media/Requests
      - PARTIAL_SEASONS=true
      - LOG_LEVEL=info
      - JAVA_OPTS=
    volumes:
      - /docker/appdata/doplarr/config:/config
    restart: unless-stopped

  syncthing:
    image: ghcr.io/linuxserver/syncthing@sha256:c112da0ec1025ac250ef5272186eb6d6cf1f2777747288c8c526b4a894b8b1b3
    container_name: syncthing
    hostname: ARRS
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - /docker/appdata/syncthing/config:/config
      - /docker/appdata/:/docker/appdata/
    ports:
      - 8384:8384
      - 22000:22000/tcp
      - 22000:22000/udp
      - 21027:21027/udp
    restart: unless-stopped

  ## Should move this to Ubu
  code-server:
    image: ghcr.io/linuxserver/code-server@sha256:11f009e81643d28f4527e3aa23f64bcd672be5ec2046be46c84755c82b5ad471
    container_name: code-server
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - SUDO_PASSWORD=$SUDO_PASSWORD
      - PROXY_DOMAIN=$PROXY_DOMAIN
    volumes:
      - /docker/appdata/code-server/config:/config
    ports:
      - 8443:8443
    restart: unless-stopped
  ## Downloaders
  sabnzbd:
    image: ghcr.io/linuxserver/sabnzbd@sha256:854dcbcc7802e863092b25e9caf155015d01b6afe2b4cee070a5127bd623c638
    container_name: sabnzbd
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /docker/appdata/sab:/config
      - /data/usenet:/data/usenet:rw
    ports:
      - 8080:8080
    restart: unless-stopped

  arch-qbittorrentvpn:
    image: binhex/arch-qbittorrentvpn:4.6.5-1-03
    container_name: qbittorrentvpn
    volumes:
      - '/docker/appdata/qbitty:/config'
      - '/data/torrents/:/data/torrents'
      - '/etc/localtime:/etc/localtime:ro'
    ports:
      - '49550:49550'
      - '49551:8118'
    environment:
      - VPN_ENABLED=yes
      - VPN_PROV=protonvpn
      - VPN_CLIENT=wireguard
      - VPN_USER=mafyuh+pmp
      - VPN_PASS=
      - STRICT_PORT_FORWARD=yes
      - LAN_NETWORK=$LAN_NETWORK
      - ENABLE_PRIVOXY=yes
      - PUID=1000
      - PGID=1000
      - WEBUI_PORT=49550
      - UMASK=1000
      - DEBUG=false
    cap_add:
      - NET_ADMIN
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
    privileged: true
    network_mode: bridge
    restart: unless-stopped

  flaresolverr:
    image: ghcr.io/flaresolverr/flaresolverr:v3.3.21
    container_name: flaresolverr
    ports:
      - '8191:8191'
    environment:
      - LOG_LEVEL=info
    restart: unless-stopped

  kiwix:
    command: '"*.zim"'
    image: ghcr.io/kiwix/kiwix-serve:3.7.0
    ports:
      - '8090:8080'
    volumes:
      - '/docker/appdata/wiki:/data'


networks:
  default:
    name: arrs_default

volumes:
  nas:
    driver: local
    driver_opts:
      type: nfs
      o: addr=nas.lan,vers=4,rw
      device: ":/mnt/thePool/thePoolShare/Media"