fix(ports): 宿主机端口改为 10223-10230,绑定 127.0.0.1

原端口(8080-9001)在 Windows/Hyper-V 环境下可能被系统排除导致绑定失败。
统一改用 10223 起顺序编号,同时绑定 127.0.0.1 限制只有本机 nginx 可访问:
  10223 tenant-service   10224 file-service    10225 tenant-web
  10226 ops-web          10227 im-service      10228 push-service
  10229 update-service   10230 license-service

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
徐勤民 2026-05-20 15:40:28 +08:00
父节点 2a250e79a0
当前提交 69da547866
共有 2 个文件被更改,包括 28 次插入28 次删除

查看文件

@ -18,7 +18,7 @@ services:
image: ${REGISTRY}/tenant-service:${IMAGE_TAG} image: ${REGISTRY}/tenant-service:${IMAGE_TAG}
profiles: ["base"] profiles: ["base"]
ports: ports:
- "9001:9001" - "127.0.0.1:10223:9001"
env_file: env_file:
- ./config/xuqm.env # 业务配置:运行模式、域名、功能开关 - ./config/xuqm.env # 业务配置:运行模式、域名、功能开关
- ./config/secrets.env # 敏感配置密码、Token - ./config/secrets.env # 敏感配置密码、Token
@ -43,7 +43,7 @@ services:
image: ${REGISTRY}/file-service:${IMAGE_TAG} image: ${REGISTRY}/file-service:${IMAGE_TAG}
profiles: ["base"] profiles: ["base"]
ports: ports:
- "8086:8086" - "127.0.0.1:10224:8086"
env_file: env_file:
- ./config/xuqm.env - ./config/xuqm.env
- ./config/secrets.env - ./config/secrets.env
@ -68,7 +68,7 @@ services:
image: ${REGISTRY}/tenant-web:${IMAGE_TAG} image: ${REGISTRY}/tenant-web:${IMAGE_TAG}
profiles: ["base"] profiles: ["base"]
ports: ports:
- "8080:80" - "127.0.0.1:10225:80"
restart: unless-stopped restart: unless-stopped
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@ -79,7 +79,7 @@ services:
image: ${REGISTRY}/ops-web:${IMAGE_TAG} image: ${REGISTRY}/ops-web:${IMAGE_TAG}
profiles: ["base"] profiles: ["base"]
ports: ports:
- "8081:80" - "127.0.0.1:10226:80"
restart: unless-stopped restart: unless-stopped
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@ -114,7 +114,7 @@ services:
image: ${REGISTRY}/im-service:${IMAGE_TAG} image: ${REGISTRY}/im-service:${IMAGE_TAG}
profiles: ["im"] profiles: ["im"]
ports: ports:
- "8082:8082" - "127.0.0.1:10227:8082"
env_file: env_file:
- ./config/xuqm.env - ./config/xuqm.env
- ./config/secrets.env - ./config/secrets.env
@ -139,7 +139,7 @@ services:
image: ${REGISTRY}/push-service:${IMAGE_TAG} image: ${REGISTRY}/push-service:${IMAGE_TAG}
profiles: ["push"] profiles: ["push"]
ports: ports:
- "8083:8083" - "127.0.0.1:10228:8083"
env_file: env_file:
- ./config/xuqm.env - ./config/xuqm.env
- ./config/secrets.env - ./config/secrets.env
@ -159,7 +159,7 @@ services:
image: ${REGISTRY}/update-service:${IMAGE_TAG} image: ${REGISTRY}/update-service:${IMAGE_TAG}
profiles: ["update"] profiles: ["update"]
ports: ports:
- "8084:8084" - "127.0.0.1:10229:8084"
env_file: env_file:
- ./config/xuqm.env - ./config/xuqm.env
- ./config/secrets.env - ./config/secrets.env
@ -182,7 +182,7 @@ services:
image: ${REGISTRY}/license-service:${IMAGE_TAG} image: ${REGISTRY}/license-service:${IMAGE_TAG}
profiles: ["license"] profiles: ["license"]
ports: ports:
- "8085:8085" - "127.0.0.1:10230:8085"
env_file: env_file:
- ./config/xuqm.env - ./config/xuqm.env
- ./config/secrets.env - ./config/secrets.env

查看文件

@ -658,7 +658,7 @@ docker compose \
printf ' 等待 tenant-service 启动' printf ' 等待 tenant-service 启动'
for i in $(seq 1 40); do for i in $(seq 1 40); do
code="$(curl -skL --noproxy '*' -o /dev/null -w '%{http_code}' --max-time 4 \ code="$(curl -skL --noproxy '*' -o /dev/null -w '%{http_code}' --max-time 4 \
"http://127.0.0.1:9001/actuator/health" 2>/dev/null || echo 000)" "http://127.0.0.1:10223/actuator/health" 2>/dev/null || echo 000)"
if [ "$code" = "200" ]; then if [ "$code" = "200" ]; then
printf '\n' printf '\n'
ok "tenant-service 健康 (HTTP 200)" ok "tenant-service 健康 (HTTP 200)"
@ -841,7 +841,7 @@ print(json.dumps(resp['data']))
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
--data-binary @- \ --data-binary @- \
-w "\n__HTTP_STATUS__:%{http_code}" \ -w "\n__HTTP_STATUS__:%{http_code}" \
"http://127.0.0.1:9001/api/private/deployment/migrate/import") "http://127.0.0.1:10223/api/private/deployment/migrate/import")
_IMPORT_STATUS=$(printf '%s' "$_IMPORT_RESP" | grep -o '__HTTP_STATUS__:[0-9]*' | cut -d: -f2) _IMPORT_STATUS=$(printf '%s' "$_IMPORT_RESP" | grep -o '__HTTP_STATUS__:[0-9]*' | cut -d: -f2)
_IMPORT_BODY=$(printf '%s' "$_IMPORT_RESP" | sed 's/__HTTP_STATUS__:[0-9]*//') _IMPORT_BODY=$(printf '%s' "$_IMPORT_RESP" | sed 's/__HTTP_STATUS__:[0-9]*//')
if [ "${_IMPORT_STATUS}" != "200" ]; then if [ "${_IMPORT_STATUS}" != "200" ]; then
@ -919,40 +919,40 @@ else
printf ' 密码: 同生产平台密码(原样迁移,未重置)\n' printf ' 密码: 同生产平台密码(原样迁移,未重置)\n'
fi fi
printf '\n \033[1m容器端口请在您的 nginx 中配置代理):\033[0m\n' printf '\n \033[1m容器端口请在您的 nginx 中配置代理):\033[0m\n'
printf ' 控制台前端 127.0.0.1:8080 → 代理 /\n' printf ' 控制台前端 127.0.0.1:10225 → 代理 /\n'
printf ' 运营后台 127.0.0.1:8081 → 代理 /ops\n' printf ' 运营后台 127.0.0.1:10226 → 代理 /ops\n'
printf ' 核心 API 127.0.0.1:9001 → 代理 /api/ /actuator/\n' printf ' 核心 API 127.0.0.1:10223 → 代理 /api/ /actuator/\n'
printf ' 文件服务 127.0.0.1:8086 → 代理 /file/ /api/file/\n' printf ' 文件服务 127.0.0.1:10224 → 代理 /file/ /api/file/\n'
printf ' IM 服务 127.0.0.1:8082 → 代理 /api/im/ /ws/im\n' printf ' IM 服务 127.0.0.1:10227 → 代理 /api/im/ /ws/im\n'
printf ' 版本管理 127.0.0.1:8084 → 代理 /api/v1/updates/ /api/v1/rn/\n' printf ' 版本管理 127.0.0.1:10229 → 代理 /api/v1/updates/ /api/v1/rn/\n'
printf ' License 服务 127.0.0.1:8085 → 代理 /api/license/\n' printf ' License 服务 127.0.0.1:10230 → 代理 /api/license/\n'
printf ' 推送服务 127.0.0.1:8083 (厂商回调,按需代理)\n' printf ' 推送服务 127.0.0.1:10228 (厂商回调,按需代理)\n'
printf '\n \033[1mNginx 配置参考(复制到您的 nginx server 块):\033[0m\n' printf '\n \033[1mNginx 配置参考(复制到您的 nginx server 块):\033[0m\n'
printf '\033[0;37m' printf '\033[0;37m'
cat <<'NGINX_REF' cat <<'NGINX_REF'
charset utf-8; charset utf-8;
client_max_body_size 100m; client_max_body_size 100m;
location /api/v1/updates/ { proxy_pass http://127.0.0.1:8084/api/v1/updates/; } location /api/v1/updates/ { proxy_pass http://127.0.0.1:10229/api/v1/updates/; }
location /api/v1/rn/ { proxy_pass http://127.0.0.1:8084/api/v1/rn/; } location /api/v1/rn/ { proxy_pass http://127.0.0.1:10229/api/v1/rn/; }
location /api/im/ { proxy_pass http://127.0.0.1:8082/api/im/; } location /api/im/ { proxy_pass http://127.0.0.1:10227/api/im/; }
location /ws/im { location /ws/im {
proxy_pass http://127.0.0.1:8082/ws/im; proxy_pass http://127.0.0.1:10227/ws/im;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade"; proxy_set_header Connection "upgrade";
proxy_read_timeout 3600s; proxy_read_timeout 3600s;
} }
location /api/license/ { proxy_pass http://127.0.0.1:8085/api/license/; } location /api/license/ { proxy_pass http://127.0.0.1:10230/api/license/; }
location /file/ { location /file/ {
proxy_pass http://127.0.0.1:8086/file/; proxy_pass http://127.0.0.1:10224/file/;
client_max_body_size 500m; client_max_body_size 500m;
proxy_read_timeout 300s; proxy_read_timeout 300s;
} }
location /api/ { proxy_pass http://127.0.0.1:9001/api/; } location /api/ { proxy_pass http://127.0.0.1:10223/api/; }
location /actuator/ { proxy_pass http://127.0.0.1:9001/actuator/; } location /actuator/ { proxy_pass http://127.0.0.1:10223/actuator/; }
location /ops { proxy_pass http://127.0.0.1:8081; } location /ops { proxy_pass http://127.0.0.1:10226; }
location / { proxy_pass http://127.0.0.1:8080; } location / { proxy_pass http://127.0.0.1:10225; }
NGINX_REF NGINX_REF
printf '\033[0m' printf '\033[0m'
printf '\n \033[1m部署目录\033[0m %s\n' "$ROOT_DIR" printf '\n \033[1m部署目录\033[0m %s\n' "$ROOT_DIR"