Funktionierender STand!!!

This commit is contained in:
2026-06-20 19:54:41 +02:00
parent 404c632cfc
commit cc3c0dad7b
6 changed files with 379 additions and 89 deletions

View File

@@ -2,7 +2,7 @@
set -e
cd "$(dirname "$0")/.."
HEALTH_URL="http://localhost:8091/health"
HEALTH_URL="" # leer → nutzt docker inspect health status
MAX_WAIT=180
# .env aus dem Projektroot laden (nur falls Variable nicht schon im Shell-Env gesetzt)
[ -f .env ] && source .env
@@ -59,13 +59,19 @@ LOG_PID=$!
# --- Health-Check-Schleife ---
while (( SECONDS - t0 < MAX_WAIT )); do
if curl -sf "$HEALTH_URL" >/dev/null 2>&1; then
STATUS=$(docker inspect qwen3-tts --format='{{.State.Health.Status}}' 2>/dev/null || true)
if [ "$STATUS" = "healthy" ]; then
kill "$LOG_PID" 2>/dev/null
wait "$LOG_PID" 2>/dev/null || true
printf "\n✓ Bereit: API http://localhost:8091 UI http://localhost:8092 WS-Log ws://localhost:8094/v1/audio/speech/stream [%ds]\n" $(( SECONDS - t0 ))
printf "\n✓ Bereit: API ws://localhost:8091 UI http://localhost:8092 [%ds]\n" $(( SECONDS - t0 ))
exit 0
fi
# Abbruch wenn Container schon gestoppt ist
if [ "$STATUS" = "unhealthy" ]; then
kill "$LOG_PID" 2>/dev/null
printf "\n✗ Container unhealthy. Logs:\n"
docker logs --tail=20 qwen3-tts 2>&1 | strip_ansi | grep -E "ERROR|ValueError|Exception" | head -5
exit 1
fi
if ! docker ps --filter "name=qwen3-tts" --filter "status=running" -q | grep -q .; then
kill "$LOG_PID" 2>/dev/null
printf "\n✗ Container abgestürzt. Logs:\n"