forked from votingworks/arlo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
88 lines (81 loc) · 1.84 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
version: '3'
services:
# standard postgres instance to store application data
db:
image: postgres:9.6
ports:
- 5432:5432
restart: on-failure
# creates the initial database and, maybe later, runs migrations
migrate:
build: .
command: pipenv run python create.py
volumes:
- .:/code
environment:
FLASK_ENV: development
depends_on:
- db
restart: on-failure
# API server
server:
build: .
command: pipenv run python app.py
ports:
- 3001:3001
volumes:
- .:/code
environment:
FLASK_ENV: development
depends_on:
- migrate
restart: on-failure
# simple background process to run computations outside requests
bgcompute:
build: .
command: pipenv run python bgcompute.py
volumes:
- .:/code
environment:
FLASK_ENV: development
depends_on:
- migrate
restart: on-failure
# react web client
client:
image: node:12.13.0
command: sh -c 'yarn && yarn start'
working_dir: /code
ports:
- 3000:3000
volumes:
- ./arlo-client:/code
- arlo-client-node_modules:/code/node_modules
environment:
NODE_ENV: development
ARLO_BACKEND_URL: http://server:3001/
restart: on-failure
# this is here both to create the test database and serve as a way to run server tests easily
server-tests:
build: .
command: pipenv run python create.py
volumes:
- .:/code
environment:
FLASK_ENV: test
depends_on:
- server
# provides a way to run client tests easily
client-tests:
image: node:12.13.0
command: /bin/true
working_dir: /code
volumes:
- ./arlo-client:/code
- arlo-client-node_modules:/code/node_modules
environment:
NODE_ENV: test
depends_on:
- client
volumes:
arlo-client-node_modules: