- 语音:序数解析(第一个/第二个等)、解析失败计数与 API detail.retry_remaining; 百度 ASR 固定 dev_pid 为普通话;SurgeryPipelineError 支持 extra 并入 HTTP detail。 - Demo:demo 路由与假 RTSP、客户端 index 与 README;BackendResolver 与配置调整。 - 可观测:消耗 TSV 日志、语音文件日志、终端 Markdown 辅助;相关测试与依赖更新。 - 注意:.env 仍被 gitignore,本地密钥不会进入本提交。 Made-with: Cursor
39 lines
1.4 KiB
Bash
Executable File
39 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Start PostgreSQL + MinIO from docker-compose.dev.yml and run FastAPI on the host.
|
|
# Usage: ./start.sh
|
|
# Optional: SKIP_DOCKER=1 to skip Compose and use an existing PostgreSQL instance.
|
|
# Same flow but TRUNCATE app tables before the server: ./start_fresh.sh
|
|
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$ROOT"
|
|
|
|
COMPOSE_FILE="${COMPOSE_FILE:-docker-compose.dev.yml}"
|
|
|
|
if [[ "${SKIP_DOCKER:-0}" != "1" ]]; then
|
|
echo "Starting Docker Compose services: db, minio ($COMPOSE_FILE)"
|
|
docker compose -f "$COMPOSE_FILE" up -d db minio
|
|
echo "MinIO API: http://127.0.0.1:${MINIO_PORT:-9000} console: http://127.0.0.1:${MINIO_CONSOLE_PORT:-9001}"
|
|
echo "Waiting for PostgreSQL..."
|
|
for _ in $(seq 1 60); do
|
|
if docker compose -f "$COMPOSE_FILE" exec -T db \
|
|
pg_isready -U "${POSTGRES_USER:-postgres}" -d "${POSTGRES_DB:-operation_room}" \
|
|
>/dev/null 2>&1; then
|
|
echo "PostgreSQL is ready."
|
|
break
|
|
fi
|
|
sleep 1
|
|
done
|
|
else
|
|
echo "SKIP_DOCKER=1: not starting Docker Compose; using POSTGRES_* or DATABASE_URL from the environment."
|
|
fi
|
|
|
|
export POSTGRES_USER="${POSTGRES_USER:-postgres}"
|
|
export POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-postgres}"
|
|
export POSTGRES_DB="${POSTGRES_DB:-operation_room}"
|
|
export POSTGRES_HOST="${POSTGRES_HOST:-localhost}"
|
|
export POSTGRES_PORT="${POSTGRES_PORT:-35432}"
|
|
|
|
exec uv run uvicorn main:app --host "${HOST:-0.0.0.0}" --port "${PORT:-38080}" --reload
|