From 1dadcc64824bb6dd88b9a04d2e77f918d51737b8 Mon Sep 17 00:00:00 2001 From: AlexeerCT Date: Fri, 24 Apr 2026 16:30:54 -0500 Subject: [PATCH] Fix wait_for_backend function to use the correct URL for health checks - Updated the health check logic in the wait_for_backend function to use the caller-provided URL directly, eliminating the issue of appending an extra "/health" segment that caused unnecessary delays in the frontend startup. - Added comments to clarify the changes and their impact on the entrypoint behavior. --- frontend/docker-entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/docker-entrypoint.sh b/frontend/docker-entrypoint.sh index dfb1e28d..31aacf2c 100644 --- a/frontend/docker-entrypoint.sh +++ b/frontend/docker-entrypoint.sh @@ -11,7 +11,11 @@ wait_for_backend() { echo "Esperando a que el backend esté disponible en ${url}..." while [ $attempt -le $max_attempts ]; do - if wget -q -O /dev/null "${url}/health" 2>/dev/null; then + # NOTA: usar la URL tal cual la pasa el caller. Antes esta función agregaba + # un "/health" extra al final (resultando en /api/health/health → 404), lo + # que provocaba que el entrypoint esperara 30 intentos en vano antes de + # arrancar Vite, sumando ~90 s muertos al arranque del frontend. + if wget -q -O /dev/null "${url}" 2>/dev/null; then echo "✓ Backend está listo" return 0 fi