Skip to content

Commit

Permalink
Finish postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanuan committed May 1, 2016
1 parent 3a6f9cd commit cb00f46
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
4 changes: 2 additions & 2 deletions config/connections.js
Expand Up @@ -82,8 +82,8 @@ module.exports.connections = {
***************************************************************************/
postgres: {
adapter: 'sails-postgresql',
host: 'postgres',
user: 'postgres', // optional
host: process.env.PG,
user: 'postgres',
//password: '', // optional
//database: 'sails' //optional
}
Expand Down
25 changes: 14 additions & 11 deletions docker-compose.yml
@@ -1,27 +1,29 @@
version: '2'
services:
edr:
edr-api:
build: .
ports:
- 81:80
environment:
NODE_ENV: production
PORT: 80
PG: edr-db
depends_on:
- postgres
- edr-migrations
- edr-db
- redis

postgres:
edr-db:
image: kiasaki/alpine-postgres:9.5

edr-uploader:
# image: 'vanuan/edrpou-uploader:latest'
build: ../edr-uploader
volumes:
- ../edr-uploader/data:/data/
- ./data:/data/edr/
depends_on:
- postgres
- edr
- edr-db
- edr-migrations
environment:
PG_CONNECTION_STRING: postgres://postgres@edr-db/postgres

redis:
image: 'redis'
Expand All @@ -32,8 +34,9 @@ services:
- /data

edr-migrations:
#image: vanuan/edrpou-migrations
build: ../edr-migrations
command: sh -c '/wait-for-it.sh -t 100 postgres:5432 && npm install && knex migrate:latest'
command: sh -c '/wait-for-it.sh -t 100 edr-db:5432 && npm install && knex migrate:latest'
depends_on:
- postgres
- edr-db
environment:
PG_CONNECTION_STRING: postgres://postgres@edr-db/postgres
14 changes: 14 additions & 0 deletions production.yml
@@ -0,0 +1,14 @@
version: '2'
services:
edr-api:
image: 'vanuan/edrpou-api:latest'
ports:
- 80:80

edr-uploader:
image: 'vanuan/edrpou-uploader:latest'
volumes:
- /root:/data/edr/

edr-migrations:
image: vanuan/edrpou-migrations:latest

0 comments on commit cb00f46

Please sign in to comment.