Which areas: Create Plugin
Problem:
Running two plugin development environments simultaneously (e.g. two separate plugins, or the same plugin against two different backends) currently requires both to share port 3000. Docker Compose's extends feature merges list fields like ports rather than replacing them, so adding ${GRAFANA_PORT:-3000}:3000/tcp to an extending docker-compose.yaml results in both the base's 3000:3000/tcp entry and the override being present. When both instances try to start, the second one cannot claim port 3000.
Solution:
Change the port mapping in docker-compose-base.yaml to use the same variable:
```yaml
ports:
- ${GRAFANA_PORT:-3000}:3000/tcp
```
Because both the base and the extending file then carry the same expression, Docker resolves them to the same value and deduplicates the binding. Developers can set GRAFANA_PORT=3001 in one workspace's .env to run two environments side by side. The default remains 3000, so existing .env files need no changes.
Alternatives:
Inlining the base config directly in each plugin's docker-compose.yaml instead of using extends would also avoid the merge behaviour, but would require duplicating content that extends was specifically introduced to centralise.
Additional context:
Docker Compose's merge behaviour for list fields is documented here. The variable substitution pattern is already used elsewhere in the base template (e.g. ${GRAFANA_IMAGE:-...}, ${GRAFANA_VERSION:-...}), so ${GRAFANA_PORT:-3000} follows the existing convention naturally.
Are you interested in contributing the solution? Yes
Which areas: Create Plugin
Problem:
Running two plugin development environments simultaneously (e.g. two separate plugins, or the same plugin against two different backends) currently requires both to share port 3000. Docker Compose's
extendsfeature merges list fields likeportsrather than replacing them, so adding${GRAFANA_PORT:-3000}:3000/tcpto an extendingdocker-compose.yamlresults in both the base's3000:3000/tcpentry and the override being present. When both instances try to start, the second one cannot claim port 3000.Solution:
Change the port mapping in
docker-compose-base.yamlto use the same variable:```yaml
ports:
```
Because both the base and the extending file then carry the same expression, Docker resolves them to the same value and deduplicates the binding. Developers can set
GRAFANA_PORT=3001in one workspace's.envto run two environments side by side. The default remains3000, so existing.envfiles need no changes.Alternatives:
Inlining the base config directly in each plugin's
docker-compose.yamlinstead of usingextendswould also avoid the merge behaviour, but would require duplicating content thatextendswas specifically introduced to centralise.Additional context:
Docker Compose's merge behaviour for list fields is documented here. The variable substitution pattern is already used elsewhere in the base template (e.g.
${GRAFANA_IMAGE:-...},${GRAFANA_VERSION:-...}), so${GRAFANA_PORT:-3000}follows the existing convention naturally.Are you interested in contributing the solution? Yes