From 65834d68d0d3441c4e628540d6d5c8b0a2e757c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Karniej?= Date: Sat, 8 Aug 2026 01:09:44 +0200 Subject: [PATCH] infra: bind development services to loopback (#4871) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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 --- docker-compose.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0056ea6a4..e7dc09faf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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