forked from StatCan/experimental_data_api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
65 lines (59 loc) · 1.33 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
version: '3.4'
x-env:
&env
PGHOST: db
PGDATABASE: statcan_api
READONLY_PWD: mypwd
services:
db:
image: postgres:11-alpine
environment:
POSTGRES_DB: statcan_api
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pwd1234
ports:
- '5432:5432'
volumes:
- db-data:/var/lib/postgresql/data
pg-evolve:
image: artifactory.cloud.statcan.ca/docker/pg-evolve
environment:
<< : *env
PGUSER: postgres
PGPASSWORD: pwd1234
PGOPTIONS: "-c custom.readonly_pwd=$${READONLY_PWD}"
volumes:
- ./db:/opt/pg-evolve/evolutions
command: ["sh", "-c", "until psql -c '\\q' 2> /dev/null; do sleep 1; done && pg-evolve"]
db_dataloader:
image: postgres:11-alpine
environment:
<< : *env
PGUSER: postgres
PGPASSWORD: pwd1234
depends_on:
- db
- pg-evolve
volumes:
- ./db_dataloader/:/init
working_dir: /init
entrypoint: ''
command: ['./wait-for.sh', './load-data.sh']
api:
build:
context: ./api
args:
NODE_ENV: production
depends_on:
- db
environment:
<< : *env
PGUSER: api
PGPASSWORD: "$${READONLY_PWD}"
URL_ROOT: http://localhost:8000
ports:
- '8000:8000'
- '9229:9229'
command: ['node', '--inspect=0.0.0.0', './index.js']
volumes:
db-data: