Skip to content

Commit 47ef3e0

Browse files
committed
Auto merge of #3221 - Turbo87:docker-test-db, r=jtgeibel
Docker: Improve `postgres` setup This PR allows us to use the docker-compose setup to run `cargo test` with the Dockerized Postgres server. It also adjusts the docker-compose setup a little bit to not expose the `postgres` container on *all* host interfaces, but instead only makes it available on 127.0.0.1. To run just the database container you can use: ``` docker-compose up -d postgres ``` (`-d` runs it in daemon mode) /cc `@plaets` r? `@pietroalbini`
2 parents 89ba7d8 + 1daff49 commit 47ef3e0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ services:
2828
postgres:
2929
image: postgres:9.6
3030
environment:
31-
POSTGRES_DB: cargo_registry
3231
POSTGRES_USER: postgres
3332
POSTGRES_PASSWORD: password
3433
ports:
35-
- 5432:5432
34+
- 127.0.0.1:5432:5432
3635
volumes:
36+
- ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
3737
- postgres-data:/var/lib/postgresql/data
3838

3939
backend:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CREATE DATABASE cargo_registry;
2+
CREATE DATABASE cargo_registry_test;

0 commit comments

Comments
 (0)