infra: bind development services to loopback (#4871)

## What changed

Bind the development Compose stack's published PostgreSQL, Redis,
Adminer, Keycloak, MinIO, and Prometheus ports to `127.0.0.1`.

## Why

Docker publishes a host port on every interface when no host address is
specified. Running the development stack on a remote workstation or VPS
therefore exposes its infrastructure services to that machine's public
networks. Loopback bindings retain host-local development access and
Docker's internal `buzz-net` connectivity without making those services
Internet-reachable.

## Impact

Local workflows continue using the same ports. Deliberate remote
administration now requires an SSH tunnel or another trusted
private-network path.

## Validation

- `docker compose -f docker-compose.yml config --quiet`
- Recreated the six affected services with their existing named volumes
and Docker network
- PostgreSQL remained healthy and retained all 54 application tables
- Redis, MinIO, and Prometheus health checks passed
- All affected ports were closed on the host's public IPv4 and IPv6
addresses while remaining available on loopback

Origin:
`buzz://message?channel=199eb7bc-3feb-484f-ae0e-4995123721ea&id=1c5bc387e86e21bb31677f56e1c862d4d9a17943bce91f8d93e825d029ce7f72`

Signed-off-by: Paweł Karniej <karniej.p@gmail.com>
This commit is contained in:
Paweł Karniej
2026-08-07 16:09:44 -07:00
committed by GitHub
parent 13c9e900c8
commit 65834d68d0
+7 -7
View File
@@ -10,7 +10,7 @@ services:
POSTGRES_DB: buzz
PGDATA: /var/lib/postgresql/data
ports:
- "5432:5432"
- "127.0.0.1:5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
@@ -34,7 +34,7 @@ services:
image: redis:7-alpine
container_name: buzz-redis
ports:
- "6379:6379"
- "127.0.0.1:6379:6379"
networks:
- buzz-net
healthcheck:
@@ -56,7 +56,7 @@ services:
image: adminer:latest
container_name: buzz-adminer
ports:
- "8082:8080"
- "127.0.0.1:8082:8080"
networks:
- buzz-net
depends_on:
@@ -82,7 +82,7 @@ services:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
ports:
- "8180:8080"
- "127.0.0.1:8180:8080"
networks:
- buzz-net
healthcheck:
@@ -108,8 +108,8 @@ services:
MINIO_ROOT_USER: buzz_dev
MINIO_ROOT_PASSWORD: buzz_dev_secret
ports:
- "9000:9000"
- "9001:9001"
- "127.0.0.1:9000:9000"
- "127.0.0.1:9001:9001"
volumes:
- minio-data:/data
networks:
@@ -152,7 +152,7 @@ services:
image: prom/prometheus:latest
container_name: buzz-prometheus
ports:
- "9090:9090"
- "127.0.0.1:9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus