From dbbaa44f9260118d48305cd94b8fddacbbe684ad Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Thu, 17 Sep 2026 16:31:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.test.yml | 6 ++++-- src/deployment/nginxConfig.test.ts | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docker-compose.test.yml b/docker-compose.test.yml index f522117c..3f75c718 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -11,9 +11,11 @@ services: restart: unless-stopped ports: - "${HOST_PORT:-9001}:80" + extra_hosts: + - "host.docker.internal:host-gateway" environment: # Runtime URL used by the secure customer-workbench handoff. Each # environment may override it without rebuilding the Admin image. CLIENT_WEB_URL: "${CLIENT_WEB_URL:-https://test-app.buggoglobal.com/}" - API_UPSTREAM: "http://test-api-cn.buggoglobal.com" - OVERSEAS_API_UPSTREAM: "http://test-api-global.buggoglobal.com" + API_UPSTREAM: "${API_UPSTREAM:-http://host.docker.internal:9000}" + OVERSEAS_API_UPSTREAM: "${OVERSEAS_API_UPSTREAM:-http://host.docker.internal:9300}" diff --git a/src/deployment/nginxConfig.test.ts b/src/deployment/nginxConfig.test.ts index a296661a..55caf51f 100644 --- a/src/deployment/nginxConfig.test.ts +++ b/src/deployment/nginxConfig.test.ts @@ -39,8 +39,11 @@ describe('admin nginx deployment config', () => { }) it('declares an explicit overseas gateway upstream in container deployments', () => { - expect(testCompose).toContain('API_UPSTREAM: "http://test-api-cn.buggoglobal.com"') - expect(testCompose).toContain('OVERSEAS_API_UPSTREAM: "http://test-api-global.buggoglobal.com"') + expect(testCompose).toContain('- "host.docker.internal:host-gateway"') + expect(testCompose).toContain('API_UPSTREAM: "${API_UPSTREAM:-http://host.docker.internal:9000}"') + expect(testCompose).toContain('OVERSEAS_API_UPSTREAM: "${OVERSEAS_API_UPSTREAM:-http://host.docker.internal:9300}"') + expect(testCompose).not.toContain('http://test-api-cn.buggoglobal.com') + expect(testCompose).not.toContain('http://test-api-global.buggoglobal.com') expect(testCompose).toContain('CLIENT_WEB_URL: "${CLIENT_WEB_URL:-https://test-app.buggoglobal.com/}"') expect(testCompose).not.toContain('CLIENT_WEB_URL: "http://8.163.') expect(developmentCompose).toContain('CLIENT_WEB_URL: "${CLIENT_WEB_URL:-https://dev-app.buggoglobal.com/}"')