-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
112 lines (106 loc) · 2.47 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
version: "3.8"
services:
mongodb:
container_name: mongodb
restart: unless-stopped
profiles:
- prod
- dev
logging:
driver: none
image: mongo:5.0.3
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGODB_USER
- MONGO_INITDB_ROOT_PASSWORD=$MONGODB_PASSWORD
volumes:
- db:/data/db
backend:
depends_on:
- mongodb
container_name: node-app
restart: always
build:
context: ./server
profiles:
- prod
- dev
volumes:
- ./server:/backend-app
ports:
- $NODE_LOCAL_PORT:$NODE_DOCKER_PORT
environment:
- SECRET_KEY=$APP_SECRET
- DB_HOST=mongodb
- DB_USER=$MONGODB_USER
- DB_PASSWORD=$MONGODB_PASSWORD
- DB_NAME=$MONGODB_DATABASE
- DB_PORT=27017
- PORT=$NODE_DOCKER_PORT
- PROXY_PORT=$NGINX_LOCAL_PORT
- GAPP_CLIENT_ID=$GAPP_CLIENT_ID
- GAPP_CLIENT_SECRET=$GAPP_CLIENT_SECRET
- GITPOD_WORKSPACE_URL=$GITPOD_WORKSPACE_URL
- IS_DOCKER=true
frontend:
depends_on:
- backend
container_name: react-app
restart: always
profiles:
- dev
build:
context: ./client
volumes:
- ./client:/frontend-app
ports:
- $REACT_LOCAL_PORT:$REACT_DOCKER_PORT
environment:
- CHOKIDAR_USEPOLLING=true
- PORT=$REACT_DOCKER_PORT
- PROXY_PORT=$NGINX_LOCAL_PORT
- IS_DOCKER=true
nginx_dev:
depends_on:
- backend
- frontend
container_name: nginx-proxy-dev
restart: always
profiles:
- dev
logging:
driver: none
build:
context: ./nginx
volumes:
- ./nginx/templates/dev.conf.template:/etc/nginx/templates/dev.conf.template
ports:
- $NGINX_LOCAL_PORT:$NGINX_DOCKER_PORT
environment:
- PORT=$NGINX_DOCKER_PORT
- REACT_DEV_HOST=frontend
- REACT_DEV_PORT=$REACT_DOCKER_PORT
- NODE_HOST=backend
- NODE_PORT=$NODE_DOCKER_PORT
nginx:
depends_on:
- backend
container_name: nginx-proxy
logging:
driver: none
restart: always
profiles:
- prod
build:
context: ./nginx
volumes:
- ./nginx/templates/prod.conf.template:/etc/nginx/templates/prod.conf.template
- ./nginx/client_build:/usr/share/nginx/html
ports:
- $NGINX_LOCAL_PORT:$NGINX_DOCKER_PORT
environment:
- PORT=$NGINX_DOCKER_PORT
- NODE_HOST=backend
- NODE_PORT=$NODE_DOCKER_PORT
- NGINX_ENTRYPOINT_QUIET_LOGS=1
volumes:
db: