diff --git a/services/playout/Dockerfile b/services/playout/Dockerfile index 9321056..bdf4f95 100644 --- a/services/playout/Dockerfile +++ b/services/playout/Dockerfile @@ -40,8 +40,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # ── CasparCG Server 2.5.0 (via .deb) ───────────────────────────────────────── # apt resolves the server's runtime deps (GL, ffmpeg, openal, sndfile, …). The -# deb's install dir is discovered from its file list and symlinked to -# /opt/casparcg so the entrypoint + config (which run from that dir) stay valid. +# 2.5 deb installs the executable as /usr/bin/casparcg-server-2.5 and a default +# config under /usr/share/casparcg-server-2.5/. We discover the binary from the +# package file list (matching casparcg-server*, since the name is versioned), +# and symlink its dir to /opt/casparcg so the entrypoint + config stay stable. WORKDIR /tmp/caspar RUN set -eux; \ curl -fsSL "$CASPAR_CEF_DEB_URL" -o cef.deb; \ @@ -52,14 +54,14 @@ RUN set -eux; \ echo "casparcg server package: $PKG"; \ dpkg -L "$PKG"; \ BIN=$(dpkg -L "$PKG" | while read -r f; do \ - [ -x "$f" ] || continue; \ - case "$f" in */casparcg|*/CasparCG\ Server) echo "$f";; esac; \ + [ -f "$f" ] && [ -x "$f" ] || continue; \ + case "$f" in /usr/bin/*casparcg*server*|*/casparcg|*/CasparCG\ Server) echo "$f";; esac; \ done | head -1); \ - test -n "$BIN"; \ - DIR=$(dirname "$BIN"); \ - echo "casparcg binary=$BIN dir=$DIR"; \ - if [ "$DIR" != "/opt/casparcg" ]; then rm -rf /opt/casparcg; ln -sfn "$DIR" /opt/casparcg; fi; \ - test -x "/opt/casparcg/$(basename "$BIN")"; \ + [ -n "$BIN" ] || BIN=/usr/bin/casparcg-server-2.5; \ + test -x "$BIN"; \ + echo "casparcg binary=$BIN"; \ + ln -sfn "$BIN" /usr/local/bin/casparcg; \ + rm -rf /opt/casparcg; mkdir -p /opt/casparcg; \ cd /; rm -rf /tmp/caspar /var/lib/apt/lists/* # ── NDI runtime (optional) ─────────────────────────────────────────────────── diff --git a/services/playout/entrypoint.sh b/services/playout/entrypoint.sh index e26b3d8..ee12989 100644 --- a/services/playout/entrypoint.sh +++ b/services/playout/entrypoint.sh @@ -24,16 +24,16 @@ fi # into a possibly read-only apt location), so make sure those exist + writable. mkdir -p /media/casparcg/log /media/casparcg/data /media/templates -# Launch CasparCG Server from its install dir (it reads ./casparcg.config and -# resolves relative media paths against the configured media folder). The deb -# install names the binary either 'casparcg' or 'CasparCG Server' depending on -# version, so probe both. +# Launch CasparCG Server. The 2.5 deb installs the binary on PATH (symlinked to +# /usr/local/bin/casparcg at build) and takes the config file as its first arg. +# Run from /opt/casparcg (symlink to the install dir) so any relative lookups in +# the server resolve against the install tree. cd /opt/casparcg -CASPAR_BIN="./casparcg" -[ -x "$CASPAR_BIN" ] || CASPAR_BIN="./CasparCG Server" -[ -x "$CASPAR_BIN" ] || CASPAR_BIN="./casparcg-launcher" -echo "[entrypoint] launching CasparCG: $CASPAR_BIN" -"$CASPAR_BIN" & +CASPAR_BIN="casparcg" +command -v "$CASPAR_BIN" >/dev/null || CASPAR_BIN=/usr/bin/casparcg-server-2.5 +CASPAR_CFG=/opt/casparcg/casparcg.config +echo "[entrypoint] launching CasparCG: $CASPAR_BIN $CASPAR_CFG" +"$CASPAR_BIN" "$CASPAR_CFG" & CASPAR_PID=$! # Forward termination to CasparCG so the channel closes cleanly.