-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
218 lines (200 loc) · 4.94 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
version: '3.8'
# back-end variables
x-common-variables:
&common-backend-variables
ENV: PROD
USER_URL: http://user:8000
MATCHING_URL: http://matching:8001
CODING_URL: http://coding:8002
VIDEO_URL: http://video:8003
QUESTION_URL: http://question:8004
HISTORY_URL: http://history:8005
ROOM_URL: http://room:8006
JUDGE0_URL: http://server:2358
LIVE_URL: https://peerprep.live
URI_GATEWAY: https://peerprep.live:8080
URI_VIDEO_SVC: https://peerprep.live:8003
x-logging: &default-logging
logging:
driver: json-file
options:
max-size: 100m
services:
gateway:
container_name: gateway
build:
dockerfile: Dockerfile
context: ./api-gateway
image: cs3219.azurecr.io/gateway
volumes:
- ./gateway:/home/node/app/gateway
ports:
- 8080:8080
restart: on-failure
environment:
<<: *common-backend-variables
frontend:
container_name: frontend
build:
dockerfile: Dockerfile
context: ./frontend
image: cs3219.azurecr.io/frontend
volumes:
- ./frontend:/home/node/app/frontend
ports:
- 3000:3000
restart: on-failure
environment:
<<: *common-backend-variables
REACT_APP_AGORA_APP_ID: d98a05dd04294d1e8233eb34ccfae645
REACT_APP_AGORA_APP_CERTIFICATE: 49561092f8324742be88874a6b34e331
user:
container_name: user
build:
dockerfile: Dockerfile
context: ./user-service
image: cs3219.azurecr.io/user
volumes:
- ./user-service:/home/node/app/user-service
expose:
- 8000
restart: on-failure
environment:
<<: *common-backend-variables
matching:
container_name: matching
build:
dockerfile: Dockerfile
context: ./matching-service
image: cs3219.azurecr.io/matching
volumes:
- ./matching-service:/home/node/app/matching
expose:
- 8001
restart: on-failure
environment:
<<: *common-backend-variables
coding:
container_name: coding
build:
dockerfile: Dockerfile
context: ./coding-service
image: cs3219.azurecr.io/coding
volumes:
- ./coding-service:/home/node/app/coding-service
expose:
- 8002
restart: on-failure
environment:
<<: *common-backend-variables
video:
container_name: video
build:
dockerfile: Dockerfile
context: ./video-service
image: cs3219.azurecr.io/video
volumes:
- ./video-service:/home/node/app/video_service
expose:
- 8003
restart: on-failure
environment:
<<: *common-backend-variables
AGORA_APP_CERTIFICATE: 49561092f8324742be88874a6b34e331
AGORA_APP_ID: d98a05dd04294d1e8233eb34ccfae645
question:
container_name: question
build:
dockerfile: Dockerfile
context: ./question-service
image: cs3219.azurecr.io/question
volumes:
- ./question-service:/home/node/app/question_service
expose:
- 8004
restart: on-failure
environment:
<<: *common-backend-variables
DATABASE_USERNAME: cs3219g15
DATABASE_PASSWORD: Password1234!
DATABASE_HOST: question-service.mysql.database.azure.com
history:
container_name: history
build:
dockerfile: Dockerfile
context: ./history-service
image: cs3219.azurecr.io/history
volumes:
- ./history-service:/home/node/app/history_service
expose:
- 8005
restart: on-failure
environment:
<<: *common-backend-variables
DB_CLOUD_URI: 'mongodb+srv://cs3219-history:cs3219-history@cs3219-history.u9n8v5t.mongodb.net/?retryWrites=true&w=majority'
room:
container_name: room
build:
dockerfile: Dockerfile
context: ./room-service
image: cs3219.azurecr.io/room
volumes:
- ./room-service:/home/node/app/room_service
expose:
- 8005
restart: on-failure
environment:
<<: *common-backend-variables
# Judge0
server:
image: judge0/judge0:1.13.0
volumes:
- ./judge0.conf:/judge0.conf:ro
expose:
- 2358
privileged: true
<<: *default-logging
restart: always
workers:
image: judge0/judge0:1.13.0
command: ["./scripts/workers"]
volumes:
- ./judge0.conf:/judge0.conf:ro
privileged: true
<<: *default-logging
restart: always
db:
image: postgres:13.0
env_file: judge0.conf
volumes:
- postgres-data:/var/lib/postgresql/data/
<<: *default-logging
restart: always
redis:
image: redis:6.0
command: [
"bash", "-c",
'docker-entrypoint.sh --appendonly yes --requirepass "$$REDIS_PASSWORD"'
]
env_file: judge0.conf
volumes:
- redis-data:/data
<<: *default-logging
restart: always
volumes:
question-service:
video-service:
coding-service:
matching-service:
user-service:
history-service:
room-service:
frontend:
gateway:
postgres-data:
redis-data:
# Used for local dev
# mongo:
# container_name: mongo
# image: mongo
# restart: always