chore(config): Extend production database and Sentinel configuration
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
#!/bin/bash
|
||||
echo "开始构建和部署视频平台项目..."
|
||||
|
||||
echo "1. 安装common模块到本地Maven仓库..."
|
||||
cd video-common
|
||||
# 使用-Dspring-boot.repackage.skip=true跳过Spring Boot的repackage阶段
|
||||
mvn clean install -DskipTests -Dspring-boot.repackage.skip=true
|
||||
cd ..
|
||||
|
||||
echo "2. 构建其他模块..."
|
||||
mvn clean package -DskipTests -pl '!video-common'
|
||||
|
||||
echo "3. 构建Sentinel Dashboard镜像..."
|
||||
# 检查sentinel-dashboard目录是否存在
|
||||
if [ -d "sentinel-dashboard" ]; then
|
||||
cd sentinel-dashboard
|
||||
docker build -t sentinel-dashboard:1.8.6 .
|
||||
cd ..
|
||||
else
|
||||
echo "警告: sentinel-dashboard目录不存在,跳过镜像构建"
|
||||
# 创建简单的Dockerfile用于构建Sentinel镜像
|
||||
mkdir -p sentinel-dashboard
|
||||
cat > sentinel-dashboard/Dockerfile << 'EOF'
|
||||
FROM eclipse-temurin:8-jre
|
||||
|
||||
# 下载 Sentinel 1.8.6 官方 JAR
|
||||
RUN apt-get update && \
|
||||
apt-get install -y wget && \
|
||||
wget -O /sentinel-dashboard.jar \
|
||||
https://github.com/alibaba/Sentinel/releases/download/1.8.6/sentinel-dashboard-1.8.6.jar && \
|
||||
apt-get remove -y wget && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 设置时区
|
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
|
||||
|
||||
EXPOSE 8080
|
||||
CMD ["java", "-Dserver.port=8080", "-Dcsp.sentinel.dashboard.server=localhost:8080", "-jar", "/sentinel-dashboard.jar"]
|
||||
EOF
|
||||
cd sentinel-dashboard
|
||||
docker build -t sentinel-dashboard:1.8.6 .
|
||||
cd ..
|
||||
fi
|
||||
|
||||
echo "4. 启动Docker Compose..."
|
||||
# 检查docker-compose是否可用
|
||||
if command -v docker-compose &> /dev/null; then
|
||||
docker-compose up -d
|
||||
else
|
||||
echo "警告: docker-compose命令不可用,尝试使用docker compose命令"
|
||||
docker compose up -d
|
||||
fi
|
||||
|
||||
echo "部署完成!"
|
||||
echo "服务访问地址:"
|
||||
SERVER_IP=$(hostname -I | awk '{print $1}')
|
||||
echo "- 网关: http://${SERVER_IP}:9000"
|
||||
echo "- Nacos: http://${SERVER_IP}:8848/nacos"
|
||||
echo "- Sentinel: http://${SERVER_IP}:8080"
|
||||
echo "- MinIO: http://${SERVER_IP}:9001"
|
||||
Reference in New Issue
Block a user