Skip to content

Commit

Permalink
Merge branch 'compose' of https://github.com/mschulkind/omh-dsu-ri in…
Browse files Browse the repository at this point in the history
…to feature/support-docker-compose
  • Loading branch information
emersonf committed May 25, 2015
2 parents 6fdf4d3 + abd9b0b commit a25f819
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mongo:
image: mongo:latest

postgres:
image: openmhealth/omh-postgres:latest

authorization:
image: openmhealth/omh-dsu-authorization-server:latest
links:
- mongo:omh-mongo
- postgres:omh-postgres
ports:
- "8082:8082"

resource:
image: openmhealth/omh-dsu-resource-server:latest
links:
- mongo:omh-mongo
- postgres:omh-postgres
ports:
- "8083:8083"
5 changes: 5 additions & 0 deletions resources/rdbms/postgresql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM postgres:latest
MAINTAINER Matthew Schulkind <mschulkind@gmail.com>

ADD oauth2-ddl.sql oauth2-sample-data.sql /docker-entrypoint-initdb.d/
ADD db_init.sh /docker-entrypoint-initdb.d/
6 changes: 6 additions & 0 deletions resources/rdbms/postgresql/db_init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

gosu postgres pg_ctl -w start
gosu postgres psql -U postgres < /docker-entrypoint-initdb.d/oauth2-ddl.sql
gosu postgres psql -U postgres omh < /docker-entrypoint-initdb.d/oauth2-sample-data.sql
gosu postgres pg_ctl stop
16 changes: 16 additions & 0 deletions resources/rdbms/postgresql/oauth2-sample-data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
INSERT INTO oauth_client_details (
client_id,
client_secret,
scope,
resource_ids,
authorized_grant_types,
authorities
)
VALUES (
'testClient',
'testClientSecret',
'read_data_points,write_data_points,delete_data_points',
'dataPoints',
'authorization_code,implicit,password,refresh_token',
'ROLE_CLIENT'
);

0 comments on commit a25f819

Please sign in to comment.