From e390be11bbe5d43675581d17468c9dd59ac43fa8 Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Sat, 21 Oct 2023 13:29:54 +0200 Subject: [PATCH] Don't bind internal docker-compose services to external IPs --- README.md | 6 +++--- docker-compose.yml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f578325b4..5b2fbbd57 100644 --- a/README.md +++ b/README.md @@ -143,9 +143,9 @@ Three services are defined: | name | access | credentials | description | |------|-------------------------------------------------|----------------------------|----------------------------------------| -| web | http://localhost:3000 | N/A | A container running the docs.rs binary | -| db | postgresql://cratesfyi:password@localhost:15432 | - | Postgres database used by web | -| s3 | http://localhost:9000 | `cratesfyi` - `secret_key` | MinIO (simulates AWS S3) used by web | +| web | http://0.0.0.0:3000 | N/A | A container running the docs.rs binary | +| db | postgresql://cratesfyi:password@127.0.0.1:15432 | - | Postgres database used by web | +| s3 | http://127.0.0.1:9000 | `cratesfyi` - `secret_key` | MinIO (simulates AWS S3) used by web | [docker-compose.yml]: ./docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml index ce503de9c..2dae8a11b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,7 +42,7 @@ services: POSTGRES_PASSWORD: password ports: # Use a non-standard port on the host to avoid conflicting with existing postgres servers - - "15432:5432" + - "127.0.0.1:15432:5432" healthcheck: test: ["CMD", "pg_isready", "--username", "cratesfyi"] interval: 10s @@ -57,8 +57,8 @@ services: minio server /data --console-address ":9001"; " ports: - - "9000:9000" - - "9001:9001" + - "127.0.0.1:9000:9000" + - "127.0.0.1:9001:9001" volumes: - minio-data:/data environment: @@ -82,7 +82,7 @@ services: context: ./dockerfiles dockerfile: ./Dockerfile-prometheus ports: - - "9090:9090" + - "127.0.0.1:9090:9090" healthcheck: test: ["CMD", "curl", "--silent", "--fail", "localhost:9090/-/ready"]