|
@@ -35,7 +35,9 @@ log "重启后端服务..."
|
|
|
|
|
|
|
|
# 使用 PM2 重启
|
|
# 使用 PM2 重启
|
|
|
if command -v pm2 &> /dev/null; then
|
|
if command -v pm2 &> /dev/null; then
|
|
|
- pm2 restart server 2>&1 | tee -a "$DEPLOY_LOG" || pm2 start dist/app.js --name server 2>&1 | tee -a "$DEPLOY_LOG"
|
|
|
|
|
|
|
+ # 需要设置 SERVER_PORT=3100
|
|
|
|
|
+ pm2 delete server 2>/dev/null || true
|
|
|
|
|
+ SERVER_PORT=3100 pm2 start dist/app.js --name server 2>&1 | tee -a "$DEPLOY_LOG"
|
|
|
pm2 save 2>&1 | tee -a "$DEPLOY_LOG"
|
|
pm2 save 2>&1 | tee -a "$DEPLOY_LOG"
|
|
|
else
|
|
else
|
|
|
log "PM2 未安装,跳过进程管理"
|
|
log "PM2 未安装,跳过进程管理"
|