Align API container UID with host and harden RTSP slice readiness.

Run compose api as HOST_UID/GID with cache under /tmp, poll slice files for
ready_event when ffmpeg stderr is silent, invoke batch via venv python, exclude
logs from build context, and document Docker cache/VLC troubleshooting.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
op
2026-05-27 10:56:59 +08:00
parent 3979e13ca9
commit 156e4ce095
12 changed files with 179 additions and 22 deletions

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Clear BuildKit cache and rebuild the API image (fixes corrupted layer / unpigz errors).
set -euo pipefail
cd "$(dirname "$0")/.."
echo "Pruning BuildKit cache..."
docker builder prune -af
docker buildx prune -af 2>/dev/null || true
docker rmi -f backend-api:latest 2>/dev/null || true
if [[ "${RESTART_DOCKER:-0}" == "1" ]]; then
echo "Restarting Docker..."
sudo systemctl restart docker
fi
echo "Building api image (--no-cache)..."
docker compose build api --no-cache
echo "Done. Recreate container: docker compose up -d --force-recreate api"