itxaiohanglover opened a new pull request, #415:
URL: https://github.com/apache/rocketmq-dashboard/pull/415
## What is the purpose of the change
Fixes #401, fixes #405
The frontend API base URL was hardcoded at build time. When deployed via
Docker, the built image always points to `localhost:8082`, making it impossible
to use the dashboard from other hosts without rebuilding.
## Brief changelog
- Added `env-config.js` loaded before React app, providing
`window.__ENV__.API_BASE_URL`
- Updated `remoteApi.js` to check runtime config first, then build-time env
var, then `window.location.origin`
- Added Docker entrypoint script that patches `env-config.js` at container
startup when `API_BASE_URL` env var is set
- Updated Dockerfile to use the new entrypoint
## How to use
```yaml
# docker-compose.yml
services:
rocketmq-dashboard:
image: apacherocketmq/rocketmq-dashboard:latest
environment:
- API_BASE_URL=http://your-host:8082
```
When `API_BASE_URL` is not set, the frontend defaults to
`window.location.origin` (same-origin), preserving backward compatibility.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]