DoDiODev opened a new pull request, #9207:
URL: https://github.com/apache/devlake/pull/9207
### Summary
Follow-up to #9090 using the same `${VAR:-default}` pattern. The `grafana`
service in `docker-compose-dev-{mysql,postgresql}.yml` hard-codes its host
port, its public root URL and the database it reads from. Running both dev
stacks side by side, serving Grafana behind a different proxy URL, or pointing
the dashboards at an existing database currently requires editing tracked files.
### Changes
| Variable | Replaces | Default (mysql / postgresql) |
|---|---|---|
| `GRAFANA_HOST_PORT` | published port | `3001` / `3002` |
| `GRAFANA_ROOT_URL` | `GF_SERVER_ROOT_URL` |
`http://localhost:4001/grafana` / `http://localhost:4000/grafana` |
| `GRAFANA_DATABASE_TYPE` | `DATABASE_TYPE` | `mysql` / `postgresql` |
| `GRAFANA_DATABASE_HOST` | `DATABASE_HOST` | `mysql` / `postgres` |
| `GRAFANA_DATABASE_PORT` | `DATABASE_PORT` | `3306` / `5432` |
| `GRAFANA_DATABASE_NAME` / `_USER` / `_PASSWORD` | `DATABASE_NAME` /
`_USER` / `_PASSWORD` | `lake` / `merico` / `merico` |
- The legacy `MYSQL_*` / `POSTGRES_*` variables are derived from the same
values, so dashboard images that predate the `DATABASE_*` handling in
`grafana/scripts/entrypoint.sh` (e.g. an older tag pulled via
`DEVLAKE_IMAGE_REGISTRY`) get a consistent datasource. The current entrypoint
overwrites them from `DATABASE_*`, so they are inert there.
- `env.example` documents the variables, commented out like
`DEVLAKE_IMAGE_REGISTRY`, because the services read `.env` via `env_file`.
### Verification
| Check | Result |
|---|---|
| `docker compose config` with no variables set, compared to `main` | ✅
identical except the four added legacy variables |
| All variables overridden | ✅ port, root URL, `DATABASE_*` and legacy
variables follow |
| Empty value (`GRAFANA_HOST_PORT=`) | ✅ falls back to the default |
--
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]