generated from CS3219-AY2324S1/course-assessment-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
223 lines (206 loc) · 4.33 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
219
220
221
222
223
version: "3"
services:
front-end:
container_name: front-end
build:
context: ./client/
dockerfile: Dockerfile
ports:
- 3000:3000
volumes:
- ./client:/app
- /app/node_modules
networks:
- default
api-gateway:
container_name: api-gateway
build:
context: ./api/api-gateway/
dockerfile: Dockerfile
ports:
- 5000:5000
depends_on:
mongodb:
condition: service_healthy
volumes:
- ./api/api-gateway:/app
env_file:
- .env
networks:
- default
user-service:
container_name: user-service
build:
context: ./api/user-service/
dockerfile: Dockerfile
ports:
- 8000:8000
depends_on:
mongodb:
condition: service_healthy
mysql:
condition: service_healthy
volumes:
- ./api/user-service:/app
env_file:
- .env
networks:
- default
question-service:
container_name: question-service
build:
context: ./api/question-service/
dockerfile: Dockerfile
ports:
- 8100:8100
depends_on:
mongodb:
condition: service_healthy
volumes:
- ./api/question-service:/app
env_file:
- .env
networks:
- default
matching-service:
container_name: matching-service
build:
context: ./api/matching-service/
dockerfile: Dockerfile
ports:
- 8300:8300
depends_on:
rabbitmq:
condition: service_healthy
volumes:
- ./api/matching-service:/app
env_file:
- .env
networks:
- default
sandbox-service:
container_name: sandbox-service
build:
context: ./api/sandbox-service/
dockerfile: Dockerfile
ports:
- 8400:8400
depends_on:
rabbitmq:
condition: service_healthy
volumes:
- ./api/code-sandbox-service:/app
- /var/run/docker.sock:/var/run/docker.sock
env_file:
- .env
networks:
- default
matchmaking-service:
container_name: matchmaking-service
build:
context: ./api/matchmaking-service/
dockerfile: Dockerfile
depends_on:
rabbitmq:
condition: service_healthy
volumes:
- ./api/matchmaking-service:/app
env_file:
- .env
networks:
- default
communication-service:
container_name: communication-service
build:
context: ./api/communication-service/
dockerfile: Dockerfile
ports:
- 8600:8600
depends_on:
mongodb:
condition: service_healthy
volumes:
- ./api/communication-service:/app
env_file:
- .env
networks:
- default
collaboration-socket:
container_name: collaboration-socket
build:
context: ./socket/collaboration-socket
dockerfile: Dockerfile
ports:
- 8200:8200
volumes:
- ./socket/collaboration-socket:/app
env_file:
- .env
networks:
- default
communication-socket:
container_name: communication-socket
build:
context: ./socket/communication-socket
dockerfile: Dockerfile
ports:
- 8500:8500
volumes:
- ./socket/communication-socket:/app
env_file:
- .env
networks:
- default
mysql:
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: peerprep
volumes:
- user-service-db-data:/var/lib/mysql/
- ./api/user-service/dump:/dump
ports:
- "3307:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- default
mongodb:
image: mongo
restart: always
volumes:
- mongodb-db-data:/data/db
- ./api/question-service/dump:/data/dump
ports:
- "27017:27017"
healthcheck:
test: ["CMD-SHELL", "pgrep mongod"]
interval: 10s
timeout: 10s
retries: 5
start_period: 10s
networks:
- default
rabbitmq:
image: rabbitmq
restart: always
ports:
- "5672:5672"
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 30s
retries: 3
networks:
- default
volumes:
user-service-db-data:
mongodb-db-data:
networks:
default:
name: peerprep-network