---
services:
  bazarr:
    image: ghcr.io/linuxserver/bazarr@sha256:c99ddc0c3a6c23edec34faf81a21fd9bdb60a02b3b5d916590b7a7e48254c87f
    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:f502893fc25fffd9012d85e7bf0670a948783975b9c8d91372869f072389342b
    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:447b8d85c4b1290d42b526e4cdd70af380e69bb2f70c4d2497816d7a528d2a08
    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:0068f9fa55cdf8b72b831b8fd56e9e94cf1de969cfa1f58f7ba11ee3619eaf65
    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:ca4ad72f07e532d1d414435eb43193d1dc407255e46c21c2694653ca8af4fd81
    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:8217bc80dd0a559af89ec8f93f6b2fdfbe303389c9fa8ff23a888add0fa77444
    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=${DISCORD__MAX_RESULTS}
      - DISCORD__REQUESTED_MSG_STYLE=${DISCORD__REQUESTED_MSG_STYLE}
      - SONARR__QUALITY_PROFILE=${SONARR__QUALITY_PROFILE}
      - RADARR__QUALITY_PROFILE=${RADARR__QUALITY_PROFILE}
      - SONARR__ROOTFOLDER=${SONARR__ROOTFOLDER}
      - RADARR__ROOTFOLDER=${RADARR__ROOTFOLDER}
      - PARTIAL_SEASONS=${PARTIAL_SEASONS}
      - LOG_LEVEL=${LOG_LEVEL}
      - JAVA_OPTS=${JAVA_OPTS}
    volumes:
      - /docker/appdata/doplarr/config:/config
    restart: unless-stopped

  syncthing:
    image: ghcr.io/linuxserver/syncthing@sha256:1f55fa811ad3903c4b421129966e0eea4b21d53d2471158288dc4a353e273a0a
    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:c181b7a2ae59940f276c89fd86cd4f220cdb87886d771b5becf3d4156b3c0bc1
    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:76a15e85e391eb2702ac1c6ccd90fc7b7546913065c1504f708ce9bf863aedbf
    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

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"