Skip to content

Commit

Permalink
Merge pull request #97 from giovannicuriel/fix-postgres
Browse files Browse the repository at this point in the history
fixing postgres user access.
  • Loading branch information
giovannicuriel committed Oct 2, 2018
2 parents 141947b + 865aaf3 commit 2fb3cd9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ before_install:
script:
- 'docker build -t dojot/device-manager .'
- 'docker build -t dredd/test -f tests/Dockerfile .'
- 'docker-compose -p test -f tests/docker-compose.yaml up -d kafka data-broker postgres device-manager device-manager-redis'
- 'docker-compose -p test -f tests/docker-compose.yaml up -d kafka data-broker postgres device-manager device-manager-redis postgres-users'
- 'docker-compose -p test -f tests/docker-compose.yaml run --rm test-runner'
after_success:
- travis/publish.sh
Expand Down
16 changes: 13 additions & 3 deletions tests/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,22 @@ services:
image: "zookeeper:3.4"
restart: always

postgres-users:
image: postgres:9.4-alpine
restart: on-failure
command: >
bash -c "createuser kong -d -h postgres -U postgres && createdb kong -U kong -h postgres"
depends_on:
postgres:
condition: service_healthy
logging:
driver: json-file
options:
max-size: 100m

postgres:
image: "postgres:9.4"
restart: always
environment:
POSTGRES_USER: "kong"
POSTGRES_DB: "kong"
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 10s
Expand Down

0 comments on commit 2fb3cd9

Please sign in to comment.