-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
69 lines (65 loc) · 1.9 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
# docker-compose.yml
version: "3"
services:
redis:
image: redis
container_name: redis-store
expose:
- 6379
ports:
- 6379:6379
volumes:
# Doesn't technically need to be a named volume
- red_data:/data
backend:
build: ./backend
volumes:
- ./backend:/var/www/app
# expose a named volume that works because installing
# and then mounting will hide that folder, so we need to explicitly
# show it again
# note that when reinstalling modules, we need to remove this volume
- be_modules:/var/www/app/node_modules
ports:
- 5000:5000
links:
- redis
environment:
# Change to production to reproduce prod issues
- NODE_ENV=development
# Defines what port to expose
- PORT=5000
# Since this is linked to the redis contnainer, we can do a DNS lookup by
# name.
- REDIS_URL=redis://redis-store:6379
# MTD API key used in the Express server, pulled as an environment variable
- CUMTD_API_KEY=$CUMTD_API_KEY
- SENTRY_DSN=$SENTRY_DSN
command:
sh -c 'npm run start:dev'
frontend:
build: ./frontend
volumes:
- ./frontend:/var/www/app
# expose a named volume that works because installing
# and then mounting will hide that folder, so we need to explicitly
# show it again
# note that when reinstalling modules, we need to remove this volume
- fe_modules:/var/www/app/node_modules
ports:
- 3000:3000
links:
- redis
environment:
# Change to production to reproduce prod issues
- REACT_APP_API_PORT=5000
# Defines what port to use for development, i.e. localhost:$PORT for the frontend
- PORT=3000
- TEST=OK
command:
sh -c 'npm start'
# explicitly defines the volumes so that docker-compose down -v will destroy them
volumes:
red_data:
fe_modules:
be_modules: