feat(deploy): 优化部署脚本,支持问答式配置

- start.sh: 交互式选择 IP/域名访问,自动生成 .env、.env.tools、.env.ASG
- start.sh: 移除内置克隆逻辑,需先 git clone 再执行
- 新增 docker/verify: Docker 验证环境与快速验证脚本

Made-with: Cursor
This commit is contained in:
2026-03-09 16:40:38 +08:00
parent 59a1a88e29
commit bb2373d4f6
4 changed files with 108 additions and 17 deletions
+5 -17
View File
@@ -1,7 +1,7 @@
#!/bin/bash
# EasyAI 一键部署脚本
# 支持交互式问答配置,兼容 IP 与域名两种访问方式
# 一行命令部署: bash -c "$(curl -fsSL https://git.51easyai.com/wangbo/easyai/raw/branch/main/start.sh)"
# 一行命令: git clone https://git.51easyai.com/wangbo/easyai && cd easyai && chmod +x ./start.sh && ./start.sh
set -e
@@ -9,29 +9,17 @@ set -e
DEPLOY_DRY_RUN="${DEPLOY_DRY_RUN:-0}"
# ==================== 项目初始化 ====================
# 若通过 curl | bash 运行,需先克隆项目
init_project_dir() {
local script_source
script_source="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
if [ -f "${script_source}/docker-compose.yml" ]; then
echo "📁 检测到项目目录: ${script_source}"
echo "📁 项目目录: ${script_source}"
cd "$script_source"
return 0
fi
# 通过 curl 运行时,克隆项目
echo "📥 未检测到项目目录,正在克隆 EasyAI 仓库..."
EASYAI_DIR="${EASYAI_DIR:-$HOME/easyai}"
if [ -d "$EASYAI_DIR" ]; then
echo "📁 使用已有目录: $EASYAI_DIR"
cd "$EASYAI_DIR"
else
git clone --depth 1 https://git.51easyai.com/wangbo/easyai.git "$EASYAI_DIR" || {
echo "❌ 克隆失败,请检查网络或手动克隆: git clone https://git.51easyai.com/wangbo/easyai.git"
exit 1
}
cd "$EASYAI_DIR"
fi
echo "❌ 未找到 docker-compose.yml,请在 easyai 项目目录下运行 start.sh"
echo " 启动命令: git clone https://git.51easyai.com/wangbo/easyai && cd easyai && chmod +x ./start.sh && ./start.sh"
exit 1
}
# ==================== 配置变量(支持环境变量非交互模式) ====================