services:
    plex_debrid:
        container_name: plex_debrid
        image: itstoggle/plex_debrid
        restart: unless-stopped
        pull_policy: always
        network_mode: host
        volumes:
            - /home/plex/plex_debrid/config/:/config
        tty: true
        stdin_open: true

    jackett:
        container_name: jackett
        image: lscr.io/linuxserver/jackett:latest
        restart: unless-stopped
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Europe/London
            - AUTO_UPDATE=true
        ports:
            - 9117:9117
        volumes:
            - /home/plex/jackett/config/:/config
            - /home/plex/jackett/downloads/:/downloads
        dns:
            - 1.1.1.1     

    plex:
        container_name: plex
        image: lscr.io/linuxserver/plex:latest
        restart: unless-stopped
        pull_policy: always
        network_mode: host
        environment:
            - TZ=Europe/London
        volumes:
            - /home/plex/plexmediaserver/config/:/config
            - /home/plex/plexmediaserver/transcode/:/transcode
            - /home/plex/plexmediaserver/data/:/data
        labels:
            - "com.centurylinklabs.watchtower.enable=false"

    flaresolverr:
        container_name: flaresolverr
        image: ghcr.io/flaresolverr/flaresolverr:latest
        restart: unless-stopped
        pull_policy: always
        ports:
            - 8191:8191
        environment:
            - LOG_LEVEL=info

    overseerr:
        container_name: overseerr
        image: lscr.io/linuxserver/overseerr:latest
        restart: unless-stopped
        pull_policy: always
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Europe/London
        ports:
            - 5055:5055
        volumes:
            - /home/plex/overseerr/config/:/config

    tautulli:
        container_name: tautulli
        image: lscr.io/linuxserver/tautulli:latest
        restart: unless-stopped
        pull_policy: always
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Europe/London
        ports:
            - 8181:8181
        volumes:
            - /home/plex/tautulli/config/:/config    
    
    rclone:
        container_name: rclone
        image: rclone/rclone
        restart: unless-stopped
        devices:
          - /dev/fuse
        cap_add:
          - SYS_ADMIN
        security_opt:
          - apparmor:unconfined
        volumes:
          - /home/plex/plexmediaserver/data/rclone/:/mnt/mountpoint:shared
          - /home/plex/rclone.conf:/config/rclone/rclone.conf
        command: >
            mount plex:links /mnt/mountpoint
            --dir-cache-time 10s
            --allow-other
            --allow-non-empty
            --config /config/rclone/rclone.conf
    
    debridclientproxy:
        container_name: debridclientproxy
        image: kipavy/debridclientproxy
        restart: unless-stopped
        ports:
            - "80:5000"
        environment:
            - URL_PREFIX=/debrid

    watchtower:
        container_name: watchtower
        image: containrrr/watchtower:latest
        restart: unless-stopped
        pull_policy: always
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
        command: --interval 30
