Use internal service name for test container

This commit is contained in:
Zhi
2026-03-14 08:51:14 +00:00
parent 99ca422c3d
commit 149465c919

View File

@@ -34,7 +34,6 @@ services:
CONFIG_DIR: /config CONFIG_DIR: /config
LISTEN_ADDR: "0.0.0.0:${WIZARD_PORT:-8080}" LISTEN_ADDR: "0.0.0.0:${WIZARD_PORT:-8080}"
MAX_BACKUPS: "5" MAX_BACKUPS: "5"
# Allow frontend (container network) and localhost for testing
CORS_ORIGINS: http://frontend:${FRONTEND_PORT:-3000},http://127.0.0.1:${FRONTEND_PORT:-3000},http://localhost:${FRONTEND_PORT:-3000} CORS_ORIGINS: http://frontend:${FRONTEND_PORT:-3000},http://127.0.0.1:${FRONTEND_PORT:-3000},http://localhost:${FRONTEND_PORT:-3000}
ports: ports:
- "127.0.0.1:${WIZARD_PORT:-8080}:${WIZARD_PORT:-8080}" - "127.0.0.1:${WIZARD_PORT:-8080}:${WIZARD_PORT:-8080}"
@@ -75,7 +74,6 @@ services:
container_name: harborforge-test-frontend container_name: harborforge-test-frontend
restart: "no" restart: "no"
environment: environment:
# Use internal service name for backend API
VITE_API_BASE_URL: http://backend:${BACKEND_PORT:-8000} VITE_API_BASE_URL: http://backend:${BACKEND_PORT:-8000}
ports: ports:
- "127.0.0.1:${FRONTEND_PORT:-3000}:${FRONTEND_PORT:-3000}" - "127.0.0.1:${FRONTEND_PORT:-3000}:${FRONTEND_PORT:-3000}"
@@ -93,10 +91,12 @@ services:
container_name: harborforge-test-runner container_name: harborforge-test-runner
restart: "no" restart: "no"
environment: environment:
BASE_URL: http://localhost:${FRONTEND_PORT:-3000} # Use internal service name for test to reach frontend
WEB_SERVER_URL: http://localhost:${FRONTEND_PORT:-3000} BASE_URL: http://frontend:${FRONTEND_PORT:-3000}
WIZARD_URL: http://localhost:${WIZARD_PORT:-8080}/wizard FRONTEND_URL: http://frontend:${FRONTEND_PORT:-3000}
WIZARD_API_URL: http://localhost:${WIZARD_PORT:-8080} WEB_SERVER_URL: http://frontend:${FRONTEND_PORT:-3000}
WIZARD_URL: http://wizard:${WIZARD_PORT:-8080}/wizard
WIZARD_API_URL: http://wizard:${WIZARD_PORT:-8080}
CHROME_DEBUGGING_PORT: 9222 CHROME_DEBUGGING_PORT: 9222
networks: networks:
- test-network - test-network