local-dev: parameterize host-port mappings via LOCAL_DEV_*_PORT

The compose stack hard-coded host ports (postgres 5433, redis 6380,
mailpit 8025, gateway REST 8080, gateway gRPC 9090) — fine for a
clean dev machine, painful when those ports collide with other
services on the same host (e.g. a `crowdsec` sitting on
127.0.0.1:8080 or a Prometheus instance on :9090).

Every host-port mapping is now `${LOCAL_DEV_*_PORT:-<old-default>}`,
so the defaults match prior behaviour for everyone and a per-host
override is a single environment variable away. `.env` carries the
overrides as commented-out lines so the customisation surface is
discoverable without grepping the compose file. README's
"Port 8080 already in use" troubleshooting entry now points at the
new variables and the optional `docker-compose.override.yml`
workflow.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-11 10:23:42 +02:00
parent 9111dd955a
commit 5867afd168
3 changed files with 35 additions and 9 deletions
+15 -4
View File
@@ -268,10 +268,21 @@ make status docker compose ps
- **UI talks to old gateway**: Vite caches `import.meta.env` at boot.
Restart `pnpm dev` after editing
`ui/frontend/.env.development.local`.
- **Port 8080 already in use** — stop the conflicting service or
edit the host-side mapping in `docker-compose.yml` (gateway's
`ports:` entry) plus the matching `VITE_GATEWAY_BASE_URL` in
`ui/frontend/.env.development.local`.
- **Port 8080 already in use** (or any other host-port in the
stack — postgres `5433`, redis `6380`, mailpit `8025`, gateway
REST `8080`, gateway gRPC `9090`) — each host-port mapping in
`docker-compose.yml` is parameterised through
`LOCAL_DEV_*_PORT` with the listed values as defaults. Set a
non-conflicting value either by uncommenting / editing the entry
in `tools/local-dev/.env`, by exporting the variable in your
shell, or by dropping a local override into a
`tools/local-dev/docker-compose.override.yml` (compose
auto-merges that file and it stays untracked by git). When
moving the gateway REST port off `8080`, also point the Vite dev
server at the new host port via
`VITE_DEV_PROXY_TARGET=http://localhost:<port>` in
`ui/frontend/.env.development.local` (or exported per
`pnpm dev` invocation).
## Relationship to other infrastructure