version: "3.8"
services:
  tdarr:
    image: ghcr.io/haveagitgat/tdarr:latest
    container_name: tdarr-server
    init: true
    restart: unless-stopped
    ports:
      - "8265:8265"  # Web UI
      - "8266:8266"  # Server port (for nodes)
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Chicago
      - serverIP=0.0.0.0
      - serverPort=8266
      - webUIPort=8265
    volumes:
      - ./server-data:/app/server
      - ./configs:/app/configs
      - ./logs:/app/logs
      - /mnt/truenas/media:/media

  tdarr-node:
    image: ghcr.io/haveagitgat/tdarr_node:latest
    container_name: tdarr-node
    init: true
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Chicago
      - serverIP=tdarr
      - serverPort=8266
      - nodeName=manticore-gpu
    volumes:
      - ./node-data:/app/configs
      - /mnt/truenas/media:/media
      - /mnt/NV2/tdarr-cache:/temp
    deploy:
      resources:
        limits:
          memory: 28g
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    depends_on:
      - tdarr
