From 50d5e2642f02334de52bffb49c95c6b2214fe820 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Thu, 30 Jul 2026 23:26:12 +0800 Subject: [PATCH] deploy: route test API through host gateway --- docker-compose.test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 7da24ab3..04b09fa1 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -8,6 +8,8 @@ services: restart: unless-stopped ports: - "${HOST_PORT:-9001}:80" + extra_hosts: + - "host.docker.internal:host-gateway" environment: - # 当前测试后端 Gateway;以后迁移环境时只需要改这里或 Jenkins 环境变量。 - API_UPSTREAM: "${API_UPSTREAM:-http://8.163.30.128:9000}" + # Gateway 与前端容器在同一台测试服务器,通过宿主机内部地址访问。 + API_UPSTREAM: "${API_UPSTREAM:-http://host.docker.internal:9000}"