# ReelTier with Docker (NAS or Linux). Guide: https://reeltier.com/guides/docker-nas
#
#   docker compose up -d                start (pulls ghcr.io/reeltier/reeltier)
#   docker compose logs -f reeltier     what the server is saying
#   docker compose pull && docker compose up -d    update (always both services together)
#
# Change the LEFT side of each volume to your own folders.
services:
  reeltier:
    image: ghcr.io/reeltier/reeltier:latest
    container_name: reeltier
    restart: unless-stopped
    # Host network on purpose: TVs find the library by multicast (DLNA), the server sees each device's real IP
    # (it only answers your home network) and checks that every request is addressed to this machine.
    # The ports are 8770 (and 8771, HTTPS for the headset player) on the NAS itself.
    network_mode: host
    environment:
      # Another port if 8770 is taken (HTTPS uses this + 1).
      REELTIER_PUERTO: "8770"
      # Time zone for the daily scan and the logs, e.g. Europe/Berlin or America/New_York.
      TZ: ${TZ:-Etc/UTC}
    volumes:
      # ReelTier's data (ratings, decisions, caches, settings).
      - ./datos:/datos
      # Your videos: ONE folder containing "videoteca" (the library) and "descargas" (new downloads), so moving
      # between them is a rename, not a copy. Read and write: rating moves files between folders.
      - /volume1/videos:/videos
    # NVIDIA on Linux (with nvidia-container-toolkit): uncomment to convert videos on the card (h264_nvenc).
    # deploy:
    #   resources:
    #     reservations:
    #       devices:
    #         - driver: nvidia
    #           count: 1
    #           capabilities: [gpu, video, compute, utility]
    # Intel/AMD (VAAPI, common on Synology/QNAP with Intel): uncomment.
    # devices:
    #   - /dev/dri:/dev/dri

  # The daily task: scans, looks up scene data and builds the panel every day at 06:00 (TZ above).
  programador:
    image: ghcr.io/reeltier/reeltier:latest
    container_name: reeltier-programador
    restart: unless-stopped
    depends_on: [reeltier]
    network_mode: host
    command: ["programador", "06:00"]
    environment:
      TZ: ${TZ:-Etc/UTC}
    volumes:
      - ./datos:/datos
      - /volume1/videos:/videos
