diff --git a/scripts/deploy-production-atomic.sh b/scripts/deploy-production-atomic.sh index ca971a3e3..e200f40f5 100755 --- a/scripts/deploy-production-atomic.sh +++ b/scripts/deploy-production-atomic.sh @@ -37,8 +37,18 @@ candidate_dir="" docker compose -f "${compose_dir}/docker-compose.yml" up -d app -if ! curl -fsS --retry 12 --retry-delay 2 --max-time 10 \ - http://127.0.0.1:3125/login >/dev/null; then +health_ok=false +attempt=1 +while [ "$attempt" -le 15 ]; do + if curl -fsS --max-time 10 http://127.0.0.1:3125/login >/dev/null; then + health_ok=true + break + fi + sleep 2 + attempt=$((attempt + 1)) +done + +if [ "$health_ok" != true ]; then docker stop ai-chatbot-app >/dev/null 2>&1 || true docker rm ai-chatbot-app >/dev/null 2>&1 || true failed_dir="${app_dir}/.next-failed-$(date +%Y%m%dT%H%M%S)"