-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
57 lines (52 loc) · 1.12 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
version: '3.9'
services:
client:
build:
context: ./client
args:
- REACT_APP_SERVER_URL=
environment:
NODE_ENV: production
# add additional environment variables
ports:
- ${CLIENT_PORT}:80
depends_on:
- server
networks:
- client-network
server:
restart: on-failure:5
build:
context: ./server
ports:
- ${SERVER_PORT}:8080
environment:
NODE_ENV: production
MONGO_URI: mongodb://mongo:27017/mern-boilerplate
CLIENT_URL:
SESSION_SECRET: ${SESSION_SECRET}
JWT_SECRET: ${JWT_SECRET}
REFRESH_TOKEN_SECRET: ${REFRESH_TOKEN_SECRET}
SESSION_EXPIRY: ${SESSION_EXPIRY}
REFRESH_TOKEN_EXPIRY: ${REFRESH_TOKEN_EXPIRY}
# add additional environment variables
depends_on:
- mongo
networks:
- client-network
- server-network
mongo:
image: mongo:latest
ports:
- $DB_PORT:27017
volumes:
- mongo-data:/data/db
networks:
- server-network
networks:
server-network:
driver: bridge
client-network:
driver: bridge
volumes:
mongo-data: