-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·57 lines (46 loc) · 1.48 KB
/
deploy.sh
File metadata and controls
executable file
·57 lines (46 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# FuturDocuments Podman 部署脚本
set -e
echo "🚀 开始部署 FuturDocuments..."
# 检查 Podman 是否安装
if ! command -v podman &> /dev/null; then
echo "❌ Podman 未安装,请先安装 Podman"
exit 1
fi
# 检查 podman-compose 是否安装
if ! command -v podman-compose &> /dev/null; then
echo "❌ podman-compose 未安装,正在尝试安装..."
pip3 install podman-compose
fi
# 创建 .env 文件(如果不存在)
if [ ! -f .env ]; then
echo "📝 创建 .env 文件..."
cp env.example .env
echo "⚠️ 请编辑 .env 文件并设置您的 API Key"
fi
# 停止现有容器(如果存在)
echo "🛑 停止现有容器..."
podman-compose -f podman-compose.yml down --remove-orphans || true
# 构建镜像
echo "🔨 构建 Docker 镜像..."
podman-compose -f podman-compose.yml build --no-cache
# 启动服务
echo "🚀 启动服务..."
podman-compose -f podman-compose.yml up -d
# 等待服务启动
echo "⏳ 等待服务启动..."
sleep 10
# 检查服务状态
echo "📊 检查服务状态..."
podman-compose -f podman-compose.yml ps
echo "✅ 部署完成!"
echo ""
echo "🌐 前端访问地址: http://localhost:3008"
echo "🔧 后端 API 地址: http://localhost:5008"
echo "🔑 默认密码: futurdocs2024"
echo ""
echo "📝 使用以下命令查看日志:"
echo " podman-compose -f podman-compose.yml logs -f"
echo ""
echo "🛑 使用以下命令停止服务:"
echo " podman-compose -f podman-compose.yml down"