挂载更新

This commit is contained in:
2025-11-24 14:33:02 +08:00
parent a92dc6180d
commit 054eac0987
10 changed files with 438 additions and 182 deletions

View File

@@ -1,15 +1,14 @@
#!/bin/sh
set -e
#!/bin/bash
echo "========================================"
echo "校园新闻管理系统 - 前端服务启动"
echo "[INFO] 校园新闻系统 - 前端Web服务启动"
echo "========================================"
# 确保日志目录存在
# 创建日志目录
mkdir -p /app/logs
# 处理配置文件
CONFIG_TARGET="/usr/share/nginx/html/schoolNewsWeb/app-config.js"
CONFIG_TARGET="/app/dist/app-config.js"
if [ -f /app/config/app-config.js ]; then
echo "[INFO] 检测到外部配置文件,替换默认配置"
@@ -29,12 +28,15 @@ else
fi
echo "========================================"
echo "[INFO] Nginx版本: $(nginx -v 2>&1)"
echo "[INFO] 前端路径: /usr/share/nginx/html/schoolNewsWeb"
echo "[INFO] Node版本: $(node --version)"
echo "[INFO] Vite版本: $(vite --version)"
echo "[INFO] 前端路径: /app/dist"
echo "[INFO] 配置文件: $CONFIG_TARGET"
echo "[INFO] 日志路径: /app/logs"
echo "[INFO] 监听端口: 4173"
echo "========================================"
echo "[INFO] 启动Nginx..."
echo "[INFO] 启动Vite Preview服务器..."
# 启动Nginx
exec nginx -g "daemon off;"
# 启动Vite Preview前台运行
cd /app
vite preview --host 0.0.0.0 --port 4173