Map bind-mounted logs to host UID/GID via entrypoint, expose RTSP prewarm in compose, suppress health-check access noise, and return 409 when another surgery is active with orphan auto-end sweep. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
526 B
Bash
Executable File
21 lines
526 B
Bash
Executable File
#!/bin/sh
|
|
# Normalize bind-mounted logs/cache ownership for the host user (VLC, editors, etc.).
|
|
set -e
|
|
|
|
APP_UID="${APP_UID:-1000}"
|
|
APP_GID="${APP_GID:-1000}"
|
|
|
|
mkdir -p \
|
|
/app/logs/rtsp_segments \
|
|
/app/logs/video_batch \
|
|
/app/logs/app \
|
|
/app/.cache/torch
|
|
|
|
if [ "$(id -u)" = "0" ] && [ "${APP_UID}" != "0" ]; then
|
|
chown -R "${APP_UID}:${APP_GID}" /app/logs /app/.cache 2>/dev/null || true
|
|
chmod -R u+rwX,g+rwX,o+rX /app/logs 2>/dev/null || true
|
|
exec runuser -u "#${APP_UID}" -g "#${APP_GID}" -- "$@"
|
|
fi
|
|
|
|
exec "$@"
|