radieo/docker-compose.yml
Pierre-Olivier Mercier d1db6a11d8 Milestone 4: yt-dlp provider and weighted source scheduler
Add a second playback source and a weighted scheduler mixing it with
Navidrome:

- Scheduler picks a provider by SOURCE_WEIGHTS, falling through to the
  others when one has nothing ready, so no source can stall playback.
- YtdlpProvider reads a hand-maintained config/urls.txt; container URLs
  (playlist/album/label/artist) are flat-extracted and one entry is
  drawn at random, honouring the anti-repeat window. Adds Track.source_url.
- YtdlpFetcher downloads bestaudio via the yt-dlp library, reusing the
  atomic hidden-temp-then-rename pattern; Liquidsoap decodes the result.
- Queue now dispatches to a fetcher registry keyed by backend.
- Sweep orphaned download temp files on daemon startup (leftovers from a
  killed container otherwise pile up and trip the stream fallback).

Verified end-to-end: yt-dlp opus decoded and served as 192 kbps MP3, and
the 3:1 default mix observed in play history.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 17:58:24 +08:00

36 lines
1.5 KiB
YAML

services:
ingest:
build: ./ingest
image: radieo-ingest
volumes:
- ./cache:/cache # volume partagé avec le stream (rw : téléchargements)
- ./state:/state # état persistant (SQLite) hors du cache éphémère
- ./config:/config:ro # config éditable sans rebuild (urls.txt yt-dlp)
environment:
- RADIEO_CACHE_DIR=/cache
- RADIEO_STATE_DIR=/state
- RADIEO_HTTP_PORT=8080
# Source Navidrome / OpenSubsonic (voir .env / .env.example).
# Laisser vide désactive la source : le stream joue alors son cache local.
- RADIEO_NAVIDROME_URL=${RADIEO_NAVIDROME_URL:-}
- RADIEO_NAVIDROME_USER=${RADIEO_NAVIDROME_USER:-}
- RADIEO_NAVIDROME_PASSWORD=${RADIEO_NAVIDROME_PASSWORD:-}
- RADIEO_NAVIDROME_PLAYLIST=${RADIEO_NAVIDROME_PLAYLIST:-}
- RADIEO_RETENTION_KEEP=${RADIEO_RETENTION_KEEP:-20}
# Source yt-dlp : liste d'URL dans config/urls.txt (créer depuis l'exemple).
- RADIEO_YTDLP_URLS_FILE=/config/urls.txt
# Dosage du mix entre les sources (0 désactive).
- RADIEO_WEIGHT_NAVIDROME=${RADIEO_WEIGHT_NAVIDROME:-3}
- RADIEO_WEIGHT_YTDLP=${RADIEO_WEIGHT_YTDLP:-1}
restart: unless-stopped
stream:
build: ./stream
image: radieo-stream
depends_on:
- ingest
ports:
- "8000:8000" # flux HTTP : http://localhost:8000/radio.mp3
volumes:
- ./cache:/cache:ro # lecture seule : secours + résolution des chemins
restart: unless-stopped