-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
78 lines (72 loc) · 1.76 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
version: "3.1"
services:
db:
build:
context: .
dockerfile: ./db.dockerfile
args:
TEST_PARALLELISM: ${TEST_PARALLELISM:-8}
environment:
- POSTGRES_PASSWORD=admin-local
ports:
- 5432:5432
graphql:
build:
context: ./
args:
NPM_TOKEN: ${NPM_TOKEN}
command: ./node_modules/.bin/ts-node-dev -C ttypescript --inspect=0.0.0.0:9229 -- src/server.ts
depends_on:
- db
env_file:
- env/local.env
- env/docker-overrides.env
volumes:
- ./tsconfig.json:/home/node/app/tsconfig.json
- ./schema:/home/node/app/schema
- ./src:/home/node/app/src
- ./migrations:/home/node/app/migrations
- ./node_modules:/home/node/app/node_modules
ports:
- 4000:4000
- 9229:9229
# Tests booting against compiled JS output
boot-test:
build:
context: ./
args:
NPM_TOKEN: ${NPM_TOKEN}
depends_on:
- db-wait
env_file:
- env/test.env
- env/docker-overrides.env
ports:
- 4000:4000
# Runs tests b/c accessing the `db` service in CI is easiest from another service
tests:
build:
context: .
dockerfile: ./tests.dockerfile
args:
NPM_TOKEN: ${NPM_TOKEN}
depends_on:
- db-wait
env_file:
- env/test.env
- env/docker-overrides.env
environment:
- TEST_PARALLELISM=${TEST_PARALLELISM:-8}
volumes:
- ./coverage:/home/node/app/coverage
- ./.jest-cache:/home/node/app/.jest-cache
db-wait:
image: jwilder/dockerize
command: dockerize -wait tcp://db:5432 -timeout 1m
depends_on:
- db
boot-test-wait:
image: jwilder/dockerize
command: dockerize -wait tcp://boot-test:4000 -timeout 3m
depends_on:
- boot-test