feat: harden deployment and public api handoff
This commit is contained in:
@@ -37,6 +37,23 @@ fi
|
||||
"${COMPOSE[@]}" up -d --build
|
||||
"${COMPOSE[@]}" ps
|
||||
|
||||
echo "[deploy] 智念AIGC平台 is starting at http://127.0.0.1:${APP_PORT:-3000}"
|
||||
HEALTH_URL="http://127.0.0.1:${APP_PORT:-3000}/api/health"
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
echo "[deploy] Waiting for health check: ${HEALTH_URL}"
|
||||
for _ in $(seq 1 40); do
|
||||
if curl -fsS "$HEALTH_URL" >/dev/null 2>&1; then
|
||||
echo "[deploy] Health check passed."
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
if ! curl -fsS "$HEALTH_URL" >/dev/null 2>&1; then
|
||||
echo "[deploy] Health check did not pass yet. Inspect logs with: ${COMPOSE[*]} logs -f zhinian-aigc"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "[deploy] 智念AIGC平台 is available at http://127.0.0.1:${APP_PORT:-3000}"
|
||||
echo "[deploy] If this is a public server, set NEXT_PUBLIC_APP_URL in .env.local to your domain."
|
||||
echo "[deploy] Web service and zhinian-worker are both managed by Docker Compose."
|
||||
echo "[deploy] API docs: docs/API.md"
|
||||
echo "[deploy] OpenAPI: ${HEALTH_URL%/api/health}/api/v1/openapi.json"
|
||||
|
||||
Reference in New Issue
Block a user