修复前端开发环境登录 502 问题

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-04-26 15:24:37 +08:00
parent 83d9a08b97
commit 6eb0b3ac3f
2 changed files with 3 additions and 2 deletions

View File

@@ -34,7 +34,7 @@ docker-compose -f docker-compose.dev.yml up --build
- 访问:`http://localhost:3000`
- 源码通过 volume 挂载,修改后自动热更新
- API 请求通过 Vite proxy 转发到后端网关(默认 `http://host.docker.internal:80`
- API 请求通过 Vite proxy 转发到后端网关(默认走 Docker 网络容器名 `http://api-gateway`,需保证网关加入 `frontend_asset-helper-network`
**如需修改后端地址:**
```bash

View File

@@ -7,7 +7,8 @@ services:
environment:
- NODE_ENV=development
- CHOKIDAR_USEPOLLING=true
- VITE_API_BASE_URL=${VITE_API_BASE_URL:-http://host.docker.internal:80}
# 走 Docker 网络容器名,规避 host.docker.internal 仅解析到 IPv6 导致的连接失败
- VITE_API_BASE_URL=${VITE_API_BASE_URL:-http://api-gateway}
ports:
- "3000:5173"
volumes: