Skip to content

Commit fb15c29

Browse files
committed
Don't bind internal docker-compose services to external IPs
1 parent 96acfa5 commit fb15c29

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ Three services are defined:
149149

150150
| name | access | credentials | description |
151151
|------|-------------------------------------------------|----------------------------|----------------------------------------|
152-
| web | http://localhost:3000 | N/A | A container running the docs.rs binary |
153-
| db | postgresql://cratesfyi:password@localhost:15432 | - | Postgres database used by web |
154-
| s3 | http://localhost:9000 | `cratesfyi` - `secret_key` | MinIO (simulates AWS S3) used by web |
152+
| web | http://0.0.0.0:3000 | N/A | A container running the docs.rs binary |
153+
| db | postgresql://cratesfyi:password@127.0.0.1:15432 | - | Postgres database used by web |
154+
| s3 | http://127.0.0.1:9000 | `cratesfyi` - `secret_key` | MinIO (simulates AWS S3) used by web |
155155

156156
[docker-compose.yml]: ./docker-compose.yml
157157

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ services:
5151
POSTGRES_PASSWORD: password
5252
ports:
5353
# Use a non-standard port on the host to avoid conflicting with existing postgres servers
54-
- "15432:5432"
54+
- "127.0.0.1:15432:5432"
5555
healthcheck:
5656
test: ["CMD", "pg_isready", "--username", "cratesfyi"]
5757
interval: 10s
@@ -66,8 +66,8 @@ services:
6666
minio server /data --console-address ":9001";
6767
"
6868
ports:
69-
- "9000:9000"
70-
- "9001:9001"
69+
- "127.0.0.1:9000:9000"
70+
- "127.0.0.1:9001:9001"
7171
volumes:
7272
- minio-data:/data
7373
environment:
@@ -91,7 +91,7 @@ services:
9191
context: ./dockerfiles
9292
dockerfile: ./Dockerfile-prometheus
9393
ports:
94-
- "9090:9090"
94+
- "127.0.0.1:9090:9090"
9595
healthcheck:
9696
test:
9797
["CMD", "curl", "--silent", "--fail", "localhost:9090/-/ready"]

0 commit comments

Comments
 (0)