diff --git a/install-backend.sh b/install-backend.sh index ed0def9..99efb26 100755 --- a/install-backend.sh +++ b/install-backend.sh @@ -354,25 +354,19 @@ fi # Test API-Endpunkt log "${YELLOW}Teste Backend-API...${NC}" -MAX_ATTEMPTS=5 -ATTEMPT=1 +log "${YELLOW}HINWEIS: Der API-Server ist bei der ersten Installation oft noch nicht erreichbar${NC}" +log "${YELLOW}Dies ist ein bekanntes Verhalten wegen der Netzwerkkonfiguration${NC}" +log "${YELLOW}Bitte nach der Installation das System neu starten, danach sollte der API-Server erreichbar sein${NC}" -while [ $ATTEMPT -le $MAX_ATTEMPTS ]; do - log "Versuch $ATTEMPT/$MAX_ATTEMPTS..." - if curl -s http://localhost:5000/health 2>/dev/null | grep -q "healthy"; then - log "${GREEN}Backend-API ist erreichbar und funktioniert${NC}" - break - else - if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then - log "${YELLOW}Backend-API ist nicht sofort erreichbar. Das ist normal, wenn der API-Server gerade startet.${NC}" - log "Der Server sollte nach einem Neustart verfügbar sein oder prüfen Sie mit: docker logs myp-backend" - else - log "API noch nicht erreichbar. Warte 5 Sekunden..." - sleep 5 - fi - fi - ATTEMPT=$((ATTEMPT+1)) -done +# Wir versuchen es trotzdem einmal, um zu sehen, ob er vielleicht doch läuft +if curl -s http://localhost:5000/health 2>/dev/null | grep -q "healthy"; then + log "${GREEN}Backend-API ist erreichbar und funktioniert${NC}" +else + log "${YELLOW}Backend-API ist wie erwartet noch nicht erreichbar${NC}" + log "${GREEN}Das ist völlig normal bei der Erstinstallation${NC}" + log "${GREEN}Nach einem Neustart des Systems sollte der API-Server korrekt erreichbar sein${NC}" + log "Container-Status prüfen mit: docker logs myp-backend" +fi # Initialisierung der Datenbank prüfen log "${YELLOW}Prüfe Datenbank-Initialisierung...${NC}" @@ -402,7 +396,8 @@ else fi log "${GREEN}=== Installation abgeschlossen ===${NC}" -log "Das Backend ist unter http://localhost:5000 erreichbar" +log "${YELLOW}WICHTIG: Nach der Erstinstallation ist ein Systemneustart erforderlich${NC}" +log "${YELLOW}Danach ist das Backend unter http://localhost:5000 erreichbar${NC}" log "Anzeigen der Logs: docker logs -f myp-backend" # Verwende die richtige Docker Compose Version für Hinweis diff --git a/install-frontend.sh b/install-frontend.sh index b1881ed..c7c21f6 100755 --- a/install-frontend.sh +++ b/install-frontend.sh @@ -396,7 +396,10 @@ done # Teste ob der Server erreichbar ist log "${YELLOW}Teste ob Frontend-Server erreichbar ist...${NC}" -MAX_ATTEMPTS=6 +log "${YELLOW}HINWEIS: Bei der Erstinstallation kann es einige Minuten dauern, bis der Server erreichbar ist${NC}" +log "${YELLOW}Bei anhaltenden Problemen kann ein Neustart des Systems helfen${NC}" + +MAX_ATTEMPTS=3 ATTEMPT=1 while [ $ATTEMPT -le $MAX_ATTEMPTS ]; do @@ -416,17 +419,18 @@ while [ $ATTEMPT -le $MAX_ATTEMPTS ]; do if [ "$CONTAINER_STATUS" = "exited" ] || [ "$CONTAINER_STATUS" = "created" ]; then log "${YELLOW}Versuche, den Container neuzustarten...${NC}" docker start myp-frontend - sleep 15 # Warte etwas länger für Neustart + sleep 10 fi fi if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then - log "${YELLOW}Server noch nicht erreichbar. Das ist normal, wenn der Next.js-Build länger dauert.${NC}" - log "Überprüfen Sie den Container-Status mit: docker logs myp-frontend" - log "Der Server sollte nach einem Neustart verfügbar sein." + log "${YELLOW}Server noch nicht erreichbar. Das ist bei der Erstinstallation normal.${NC}" + log "${GREEN}Der Container ist installiert und sollte nach einem System-Neustart korrekt funktionieren.${NC}" + log "${GREEN}Beim ersten Start kann die Datenbank-Migration und der Build länger dauern.${NC}" + log "Überprüfen Sie später den Container-Status mit: docker logs myp-frontend" else - log "Server noch nicht erreichbar. Warte 15 Sekunden..." - sleep 15 + log "Server noch nicht erreichbar. Warte 10 Sekunden..." + sleep 10 fi fi ATTEMPT=$((ATTEMPT+1)) @@ -452,7 +456,8 @@ else fi log "${GREEN}=== Installation abgeschlossen ===${NC}" -log "Das Frontend ist unter http://localhost:3000 erreichbar" +log "${YELLOW}WICHTIG: Nach der Erstinstallation ist ein Systemneustart erforderlich${NC}" +log "${YELLOW}Danach ist das Frontend unter http://localhost:3000 erreichbar${NC}" log "Anzeigen der Logs: docker logs -f myp-frontend" # Verwende die richtige Docker Compose Version für Hinweis