Files
n8n-guide/deploy.sh
2025-09-11 14:00:33 +08:00

42 lines
955 B
Bash
Raw Permalink 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.

#!/bin/bash
# n8n指南部署脚本
# 适用于公网服务器部署
echo "🚀 开始部署n8n指南..."
# 检查Docker是否安装
if ! command -v docker &> /dev/null; then
echo "❌ Docker未安装请先安装Docker"
exit 1
fi
# 检查Docker Compose是否安装
if ! command -v docker-compose &> /dev/null; then
echo "❌ Docker Compose未安装请先安装Docker Compose"
exit 1
fi
# 停止现有容器
echo "🛑 停止现有容器..."
docker-compose down
# 构建并启动服务
echo "🔨 构建并启动服务..."
docker-compose up -d --build
# 检查服务状态
echo "📊 检查服务状态..."
sleep 5
docker-compose ps
# 检查端口占用
echo "🔍 检查端口8000状态..."
if netstat -tlnp | grep :8000 > /dev/null; then
echo "✅ 服务已启动访问地址http://your-server-ip:8000"
else
echo "❌ 服务启动失败请检查日志docker-compose logs"
fi
echo "🎉 部署完成!"