-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
48 lines (45 loc) · 1.21 KB
/
docker-compose.prod.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
# docker-compose.yml
version: "3"
services:
redis:
image: redis
container_name: redis-store
expose:
- 6379
backend:
build: ./backend
ports:
- 5000:5000
links:
- redis
environment:
# Change to production to reproduce prod issues
- NODE_ENV=production
# 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
command:
sh -c 'npm run start:dev'
frontend:
build:
context: ./frontend
dockerfile: Dockerfile-prod
ports:
- 3000:3000
links:
- redis
depends_on:
- redis
- backend
environment:
- REACT_APP_API_PORT=5000
command:
# Despite being built off the prod image that has the compiled build,
# we are using the dev version because this will let us use localhost:PORT as the API endpoint
# which gets baked into the prod image and is thus unaffected by env vars from this file
sh -c 'npm start'
stdin_open: true