forked from StatCan/experimental_data_api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.test.yml
77 lines (70 loc) · 1.62 KB
/
docker-compose.test.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
version: '3.4'
x-env:
&env
PGHOST: db_test
PGDATABASE: statcan_api
READONLY_PWD: mypwd
services:
db_test:
image: postgres:11-alpine
environment:
POSTGRES_DB: statcan_api
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pwd1234
networks:
- test
ports:
- '5432:5432'
logging:
driver: none
pg-evolve_test:
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 && tail -f /dev/null"]
networks:
- test
db_dataloader_test:
image: postgres:11-alpine
environment:
<< : *env
PGUSER: postgres
PGPASSWORD: pwd1234
depends_on:
- db_test
- pg-evolve_test
volumes:
- ./test_data:/init
working_dir: /init
entrypoint: ''
command: ['sh', '-c', './wait-for.sh ./load-data.sh && tail -f /dev/null']
networks:
- test
test:
build:
context: ./api
image: api_test
depends_on:
- db_dataloader_test
environment:
<< : *env
PGUSER: api
PGPASSWORD: "$${READONLY_PWD}"
URL_ROOT: http://localhost:8000
volumes:
- ./api/.eslintrc.json:/home/node/app/.eslintrc.json
- ./api/test:/home/node/app/test
command: ['sh', '-c', 'node test/_waitFor.js && npm run test-unit']
tty: true
networks:
- test
ports:
- '8000:8000'
- '9229:9229'
networks:
test: