fix(ops): wait for production container startup
This commit is contained in:
parent
f0a24a1a99
commit
1d84b1b1c0
@ -37,8 +37,18 @@ candidate_dir=""
|
|||||||
|
|
||||||
docker compose -f "${compose_dir}/docker-compose.yml" up -d app
|
docker compose -f "${compose_dir}/docker-compose.yml" up -d app
|
||||||
|
|
||||||
if ! curl -fsS --retry 12 --retry-delay 2 --max-time 10 \
|
health_ok=false
|
||||||
http://127.0.0.1:3125/login >/dev/null; then
|
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 stop ai-chatbot-app >/dev/null 2>&1 || true
|
||||||
docker rm 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)"
|
failed_dir="${app_dir}/.next-failed-$(date +%Y%m%dT%H%M%S)"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user