#!/usr/bin/env sh set -eu SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd) INFRA_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd) API_PORT="${API_PORT:-8000}" BOOTSTRAP_ON_UP="${BOOTSTRAP_ON_UP:-true}" cd "$INFRA_DIR" docker compose -f docker-compose.prod.yml up --build -d echo "等待生产 API 健康检查..." until curl -fsS "http://127.0.0.1:${API_PORT}/health" >/dev/null 2>&1; do sleep 3 done if [ "$BOOTSTRAP_ON_UP" = "true" ]; then echo "执行 bootstrap 样本初始化..." until curl -fsS -X POST "http://127.0.0.1:${API_PORT}/poc/ingest/bootstrap" >/dev/null 2>&1; do sleep 3 done fi echo "生产环境已启动。Web: http://127.0.0.1:${WEB_PORT:-80} API: http://127.0.0.1:${API_PORT}/docs"