修复前端开发环境登录 502 问题
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -34,7 +34,7 @@ docker-compose -f docker-compose.dev.yml up --build
|
|||||||
|
|
||||||
- 访问:`http://localhost:3000`
|
- 访问:`http://localhost:3000`
|
||||||
- 源码通过 volume 挂载,修改后自动热更新
|
- 源码通过 volume 挂载,修改后自动热更新
|
||||||
- API 请求通过 Vite proxy 转发到后端网关(默认 `http://host.docker.internal:80`)
|
- API 请求通过 Vite proxy 转发到后端网关(默认走 Docker 网络容器名 `http://api-gateway`,需保证网关加入 `frontend_asset-helper-network`)
|
||||||
|
|
||||||
**如需修改后端地址:**
|
**如需修改后端地址:**
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
- NODE_ENV=development
|
||||||
- CHOKIDAR_USEPOLLING=true
|
- 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:
|
ports:
|
||||||
- "3000:5173"
|
- "3000:5173"
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user