forked from DanKottke/midas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
109 lines (109 loc) · 2.29 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
version: '3'
services:
app:
build:
dockerfile: Dockerfile
context: .
volumes:
- .:/app
- node-modules:/app/node_modules/
working_dir: /app
command:
- /wait-for-migrate-db-container.sh
- db
- npm run watch
ports:
- 3000:3000
links:
- db
- mail
networks:
- mail
- backend
environment:
- PATH=/app/node_modules/.bin:$PATH
- DATABASE_URL=postgres://midas@db/midas
- DATASTORE=postgresql
- LOG_LEVEL=silly
- PORT=3000
- EMAIL_HOST=mail
- EMAIL_SSL=false
- EMAIL_IGNORE_TLS=true
- EMAIL_PORT=25
- SAILS_SECRET=just_for_testing_yo
- 'VCAP_APPLICATION={ "uris": [ "openopps-test.18f.gov" ] }'
depends_on:
- db
- mail
- migrate_db
- init_db
# README: Migrate the database so that npm run init can write to it.
migrate_db:
networks:
- backend
build:
dockerfile: Dockerfile
context: .
command: npm run migrate
volumes:
- .:/app
- node-modules:/app/node_modules/
environment:
- PATH=/app/node_modules/.bin:$PATH
- DATABASE_URL=postgres://midas@db/midas
- DATASTORE=postgresql
- LOG_LEVEL=silly
- PORT=3002
links:
- db
depends_on:
- db
mail:
image: tophfr/mailcatcher
ports:
- 8025:80 # for the web UI
networks:
- mail
# README: Initialize the database so that Sails can connect to it.
init_db:
networks:
- backend
build:
dockerfile: Dockerfile
context: .
command:
- /wait-for-migrate-db-container.sh
- db
- npm run init
volumes:
- .:/app
- node-modules:/app/node_modules/
environment:
- PATH=/app/node_modules/.bin:$PATH
- DATABASE_URL=postgres://midas@db/midas
- DATASTORE=postgresql
- LOG_LEVEL=silly
- PORT=3001
links:
- db
depends_on:
- db
- migrate_db
db:
networks:
- backend
image: postgres:9.3
volumes:
- pgdata:/var/lib/postgresql/data/
environment:
- POSTGRES_DB=midas
- POSTGRES_USER=midas
volumes:
node-modules:
pgdata:
networks:
mail:
driver: bridge
backend:
driver: bridge