Files
AI-Testing/start.sh
2026-04-12 20:10:08 +08:00

26 lines
742 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT_DIR"
echo "==> 构建并启动所有服务..."
docker compose up --build -d
echo "==> 当前容器状态"
docker compose ps
if [[ -f ".env" ]]; then
echo "==> 检测到 .env将覆盖 .env.example 中的同名 AI 变量)"
else
echo "==> AI 配置来自 .env.example请填写 QWEN_API_KEY亦可复制为 .env 再填写)"
fi
echo "==> 健康检查(端口与 docker-compose.yml 一致:后端 8866前端 Nginx 8173"
echo "backend: $(curl -sf http://localhost:8866/health || echo 'unreachable')"
echo "frontend (nginx): $(curl -sf http://localhost:8173/health || echo 'unreachable')"
echo "==> 启动完成"