chore: 部署脚本增加自动清理旧 blog-mysql 容器逻辑
Build and Deploy Blog / deploy (push) Successful in 24s

This commit is contained in:
2026-10-22 15:42:38 +08:00
parent 0ead154dc9
commit ea09c73f2b
2 changed files with 9 additions and 2 deletions
+6 -2
View File
@@ -11,12 +11,16 @@ if [ -d ".git" ]; then
git pull origin main || true
fi
# 2. 重新编译后端与前端容器
# 2. 清理旧的独立 blog-mysql 容器(改用 1Panel 现有 MySQL)
docker stop blog-mysql 2>/dev/null || true
docker rm blog-mysql 2>/dev/null || true
# 3. 重新编译后端与前端容器
echo "🐳 [Docker] 重新构建并运行全栈容器..."
docker compose down
docker compose up -d --build
# 3. 检查服务健康状态
# 4. 检查服务健康状态
echo "⏳ [HealthCheck] 等待服务启动..."
sleep 3
docker ps --filter "name=blog-"