Add a docker-compose file

This commit is contained in:
Grégoire Delattre 2016-02-22 13:56:51 +01:00
parent 4bd09d352d
commit 6a0978e490
2 changed files with 23 additions and 3 deletions

View File

@ -1,5 +1,16 @@
# Run tests
## Setup the dev env
Use lastest postgres docker from https://hub.docker.com/r/library/postgres/ and run:
Just run the docker-compose file to create the database.
env POSTGRES_DSN="postgres://test:test@192.168.99.100:32771/test?sslmode=disable" go test -v -p=1 ./...
```
docker-compose up -d
```
## Run the tests
```
POSTGRES_DSN="postgres://test:test@127.0.0.1:5432/test?sslmode=disable" go test -v -p=1 ./...
```

9
docker-compose.yml Normal file
View File

@ -0,0 +1,9 @@
postgresql:
image: postgres:9.5
container_name: canape_postgresql_dev
restart: always
environment:
- POSTGRES_PASSWORD=test
- POSTGRES_USER=test
ports:
- 127.0.0.1:5432:5432