compose: healthcheck on ingest, stream waits for it

Add a Docker healthcheck probing ingest's /healthz (via python, since the slim
image has neither curl nor wget) and make the stream start only once ingest is
service_healthy, so it never briefly falls back on an empty cache at boot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-07-02 22:47:05 +08:00
commit 9e0f4c2066

View file

@ -29,13 +29,22 @@ services:
# Canonicalizer MusicBrainz (identité MBID inter-sources ; sans clé).
- RADIEO_CANONICAL_ENABLED=${RADIEO_CANONICAL_ENABLED:-1}
- RADIEO_USER_AGENT=${RADIEO_USER_AGENT:-radieo/0.1 (personal music radio)}
healthcheck:
# python-slim n'a ni curl ni wget : on sonde /healthz en Python.
test: ["CMD", "python", "-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8080/healthz')"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
restart: unless-stopped
stream:
build: ./stream
image: radieo-stream
depends_on:
- ingest
ingest:
condition: service_healthy
ports:
- "8000:8000" # flux HTTP : http://localhost:8000/radio.mp3
volumes: