# Tdarr Node - NUC-QSV (Intel Quick Sync Video hardware transcoding)
# Runs on Proxmox LXC 103 (tdarr-node)
# Connects to Tdarr Server on Synology (atlantis) at 192.168.0.200
#
# NFS Mounts required in LXC:
#   /mnt/media -> 192.168.0.200:/volume1/data/media
#   /mnt/cache -> 192.168.0.200:/volume3/usenet
#
# Important: Both /temp and /cache must be mounted to the same base path
# as the server's cache to avoid path mismatch errors during file operations.

services:
  tdarr-node:
    image: ghcr.io/haveagitgat/tdarr_node:latest
    container_name: tdarr-node
    security_opt:
      - apparmor:unconfined
    environment:
      - PUID=1029
      - PGID=100
      - TZ=America/Los_Angeles
      - UMASK=022
      - nodeName=NUC
      - serverIP=192.168.0.200
      - serverPort=8266
      - inContainer=true
      - ffmpegVersion=6
    devices:
      - /dev/dri:/dev/dri  # Intel QSV hardware acceleration
    volumes:
      - ./configs:/app/configs
      - ./logs:/app/logs
      - /mnt/media:/media
      - /mnt/cache/tdarr_cache:/temp   # Server uses both /temp and /cache
      - /mnt/cache/tdarr_cache:/cache  # Must mount both for node compatibility
    restart: unless-stopped

# Auto-update: handled by cron — Watchtower 1.7.1 uses Docker API 1.25 which is incompatible
# with Docker 29.x (minimum API 1.44). Instead, a cron job runs hourly:
#   /etc/cron.d/tdarr-update  →  cd /opt/tdarr && docker compose pull -q && docker compose up -d
# Set up with: pct exec 103 -- bash -c 'see hosts/proxmox/lxc/tdarr-node/README for setup'
