fix: preserve stable Admin proxy port

This commit is contained in:
2026-09-20 23:39:39 +08:00
parent 3f78e1d087
commit b9e5bf3fec
2 changed files with 7 additions and 3 deletions
+3 -3
View File
@@ -62,12 +62,12 @@ compose() {
case "$service" in
admin-web)
base_port=9001
nginx_config=/www/server/panel/vhost/nginx/admin.buggoglobal.com.conf
nginx_config=/www/server/panel/vhost/nginx/00-blue-green-admin-web.conf
legacy_container=firstleg-prod-admin-web
;;
client-web)
base_port=9002
nginx_config=/www/server/panel/vhost/nginx/app.buggoglobal.com.conf
nginx_config=/www/server/panel/vhost/nginx/00-blue-green-client-web.conf
legacy_container=firstleg-prod-client-web
;;
*) echo "不支持蓝绿部署的前端服务: $service" >&2; exit 2 ;;
@@ -102,7 +102,7 @@ fi
if [ "$active_slot" = blue ]; then target_slot=green; else target_slot=blue; fi
[ "$active_slot" = legacy ] && target_slot=green
if [ "$target_slot" = blue ]; then target_port="$base_port"; else target_port=$((base_port + 10000)); fi
if [ "$target_slot" = blue ]; then target_port=$((base_port + 20000)); else target_port=$((base_port + 10000)); fi
candidate="${legacy_container}-${target_slot}"
docker rm -f "$candidate" >/dev/null 2>&1 || true