# 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@sha256:dc23becc667f77d2489b1042REDACTED_GITEA_TOKEN  # v2.67.01 - pinned to match server
    container_name: tdarr-node
    labels:
      - com.centurylinklabs.watchtower.enable=false
    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: DISABLED — tdarr nodes must stay version-synced with the server.
# Image is pinned to a specific digest. To update all nodes at once, change the
# digest in all 4 compose files and redeploy simultaneously.
# Remove the hourly cron if it exists: pct exec 103 -- rm -f /etc/cron.d/tdarr-update
