Skip to content

Commit 801e478

Browse files
committed
Don't bind internal docker-compose services to external IPs
1 parent 05054f3 commit 801e478

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ Three services are defined:
143143

144144
| name | access | credentials | description |
145145
|------|-------------------------------------------------|----------------------------|----------------------------------------|
146-
| web | http://localhost:3000 | N/A | A container running the docs.rs binary |
147-
| db | postgresql://cratesfyi:password@localhost:15432 | - | Postgres database used by web |
148-
| s3 | http://localhost:9000 | `cratesfyi` - `secret_key` | MinIO (simulates AWS S3) used by web |
146+
| web | http://0.0.0.0:3000 | N/A | A container running the docs.rs binary |
147+
| db | postgresql://cratesfyi:password@127.0.0.1:15432 | - | Postgres database used by web |
148+
| s3 | http://127.0.0.1:9000 | `cratesfyi` - `secret_key` | MinIO (simulates AWS S3) used by web |
149149

150150
[docker-compose.yml]: ./docker-compose.yml
151151

docker-compose.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ services:
4242
POSTGRES_PASSWORD: password
4343
ports:
4444
# Use a non-standard port on the host to avoid conflicting with existing postgres servers
45-
- "15432:5432"
45+
- "127.0.0.1:15432:5432"
4646
healthcheck:
4747
test: ["CMD", "pg_isready", "--username", "cratesfyi"]
4848
interval: 10s
@@ -57,8 +57,8 @@ services:
5757
minio server /data --console-address ":9001";
5858
"
5959
ports:
60-
- "9000:9000"
61-
- "9001:9001"
60+
- "127.0.0.1:9000:9000"
61+
- "127.0.0.1:9001:9001"
6262
volumes:
6363
- minio-data:/data
6464
environment:
@@ -82,7 +82,7 @@ services:
8282
context: ./dockerfiles
8383
dockerfile: ./Dockerfile-prometheus
8484
ports:
85-
- "9090:9090"
85+
- "127.0.0.1:9090:9090"
8686
healthcheck:
8787
test:
8888
["CMD", "curl", "--silent", "--fail", "localhost:9090/-/ready"]

0 commit comments

Comments
 (0)