fix:修复bug

This commit is contained in:
Daniel
2026-04-07 18:01:32 +08:00
parent c29ff1a54b
commit 5ae8d50298
2 changed files with 49 additions and 0 deletions

View File

@@ -51,5 +51,30 @@ if [ "$AUTO_PULL" = "true" ] && [ -z "$GIT_REPO_URL_VAL" ]; then
fi
docker compose up -d --build
sleep 2
if ! docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
echo "[ERROR] container ${CONTAINER_NAME} is not running"
echo "[INFO] container status:"
docker ps -a --filter "name=^${CONTAINER_NAME}$" --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
echo "[INFO] recent logs:"
docker logs --tail 200 "${CONTAINER_NAME}" || true
exit 1
fi
if command -v curl >/dev/null 2>&1; then
HEALTH_OK=false
for _ in $(seq 1 30); do
if curl -fsS "http://127.0.0.1:${PORT}/health" >/dev/null 2>&1; then
HEALTH_OK=true
break
fi
sleep 1
done
if [ "$HEALTH_OK" = false ]; then
echo "[WARN] container is running but health endpoint is still not ready after 30s: http://127.0.0.1:${PORT}/health"
fi
fi
echo "[OK] center dispatch started"
echo "[INFO] health: curl http://127.0.0.1:${PORT}/health"