update entrypoint.sh to conditionally execute Python script or pass commands as appuser

This commit is contained in:
Lukas Pierchalla
2026-09-20 11:03:10 +02:00
parent d832741980
commit aac4a4bbaf
+8 -2
View File
@@ -5,5 +5,11 @@ set -e
chown -R ${PUID:-1000}:${PGID:-1000} /app/data /tmp/sc-config 2>/dev/null || true
chmod 700 /tmp/sc-config 2>/dev/null || true
# Auf User wechseln und Python-Skript starten
exec gosu appuser python /app/scalable_sync.py "$@"
# Wenn der erste Parameter "python" ist oder das Skript selbst → Python starten
if [ "$1" = "python" ] || [ "$1" = "/app/scalable_sync.py" ]; then
shift
exec gosu appuser python /app/scalable_sync.py "$@"
fi
# Sonst: Befehl direkt als appuser ausführen (z. B. sc login)
exec gosu appuser "$@"