mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-08 02:36:37 +08:00
优化部署
This commit is contained in:
Binary file not shown.
@@ -11,8 +11,8 @@ services:
|
|||||||
MYSQL_USER: ${DB_USER} # 数据库用户
|
MYSQL_USER: ${DB_USER} # 数据库用户
|
||||||
MYSQL_PASSWORD: ${DB_PASSWORD} # 数据库密码
|
MYSQL_PASSWORD: ${DB_PASSWORD} # 数据库密码
|
||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
# ports:
|
ports:
|
||||||
# - "3306:3306" # 不暴露到公网,只在容器内部访问
|
- "127.0.0.1:3306:3306" # 只绑定到本机内部,不暴露到公网
|
||||||
volumes:
|
volumes:
|
||||||
- mysql_data:/var/lib/mysql
|
- mysql_data:/var/lib/mysql
|
||||||
- ./gost.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
- ./gost.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||||
@@ -29,8 +29,8 @@ services:
|
|||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
container_name: gost-redis
|
container_name: gost-redis
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# ports:
|
ports:
|
||||||
# - "6379:6379" # 不暴露到公网,只在容器内部访问
|
- "127.0.0.1:6379:6379" # 只绑定到本机内部,不暴露到公网
|
||||||
networks:
|
networks:
|
||||||
- gost-network
|
- gost-network
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
|||||||
+23
-2
@@ -27,7 +27,20 @@ fi
|
|||||||
INSTALL_DIR="/etc/gost"
|
INSTALL_DIR="/etc/gost"
|
||||||
mkdir -p "$INSTALL_DIR"
|
mkdir -p "$INSTALL_DIR"
|
||||||
|
|
||||||
|
# 检查gost服务是否存在并运行
|
||||||
|
if systemctl list-units --full -all | grep -Fq "gost.service"; then
|
||||||
|
echo "检测到已存在的gost服务"
|
||||||
|
if systemctl is-active --quiet gost; then
|
||||||
|
echo "停止运行中的gost服务..."
|
||||||
|
systemctl stop gost
|
||||||
|
fi
|
||||||
|
if systemctl is-enabled --quiet gost; then
|
||||||
|
echo "禁用gost服务自启动..."
|
||||||
|
systemctl disable gost
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 删除旧文件
|
||||||
for FILE in gost config.json gost.json; do
|
for FILE in gost config.json gost.json; do
|
||||||
if [[ -f "$INSTALL_DIR/$FILE" ]]; then
|
if [[ -f "$INSTALL_DIR/$FILE" ]]; then
|
||||||
echo "删除已有文件: $INSTALL_DIR/$FILE"
|
echo "删除已有文件: $INSTALL_DIR/$FILE"
|
||||||
@@ -88,6 +101,14 @@ EOF
|
|||||||
systemctl daemon-reexec
|
systemctl daemon-reexec
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable gost
|
systemctl enable gost
|
||||||
systemctl restart gost
|
systemctl start gost
|
||||||
|
|
||||||
echo "安装完成,配置文件位于 $INSTALL_DIR,并设置为开机启动。"
|
# 检查服务状态
|
||||||
|
if systemctl is-active --quiet gost; then
|
||||||
|
echo "✅ 安装完成,gost服务已启动并设置为开机启动。"
|
||||||
|
echo "配置文件位于: $INSTALL_DIR"
|
||||||
|
echo "服务状态: $(systemctl is-active gost)"
|
||||||
|
else
|
||||||
|
echo "❌ gost服务启动失败,请检查日志:"
|
||||||
|
echo "journalctl -u gost -f"
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user