-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
274 lines (256 loc) · 6.58 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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
version: "3.7"
x-logging: &default-logging
logging:
driver: json-file
options:
max-size: 100m
services:
# Judge0
server:
image: judge0/judge0:1.13.0
container_name: "letscode-judge0"
volumes:
- ./judge0.conf:/judge0.conf:ro
ports:
- "2358:2358"
privileged: true
<<: *default-logging
restart: always
workers:
image: judge0/judge0:1.13.0
container_name: "letscode-judge0-workers"
command: ["./scripts/workers"]
volumes:
- ./judge0.conf:/judge0.conf:ro
privileged: true
<<: *default-logging
restart: always
db:
image: postgres:13.0
container_name: "letscode-judge0-db"
env_file: judge0.conf
volumes:
- postgres-data:/var/lib/postgresql/data/
<<: *default-logging
restart: always
redis:
image: redis:6.0
container_name: "letscode-judge0-redis"
command:
[
"bash",
"-c",
'docker-entrypoint.sh --appendonly yes --requirepass "$$REDIS_PASSWORD"',
]
env_file: judge0.conf
volumes:
- redis-data:/data
<<: *default-logging
restart: always
# LetsCode
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: "letscode-rabbitmq"
restart: always
ports:
- 5673:5672
- 15672:15672
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}
volumes:
- rabbitmq-data:/var/lib/rabbitmq
auth:
depends_on:
- rabbitmq
build:
context: ./be/auth
dockerfile: Dockerfile
image: letscode-auth:skripsi
container_name: letscode-auth
restart: always
ports:
- "${AUTH_PORT}:6001"
environment:
PORT: 6001
DATABASE_URL: ${MONGODB_URL}
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: ${RABBITMQ_USER}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
SECRET: ${JWT_SECRET}
CLIENT_HOST: ${CLIENT_HOST}
BACKEND_HOST: ${CLIENT_BACKEND_URL}
SUPER_EMAIL: ${SUPER_EMAIL}
SUPER_USERNAME: ${SUPER_USERNAME}
SUPER_PASSWORD: ${SUPER_PASSWORD}
SUPER_ID: ${SUPER_ID}
volumes:
- user-data:/usr/src/app/user-data
collaboration:
depends_on:
- rabbitmq
build:
context: ./be/collaboration
dockerfile: Dockerfile
image: letscode-collaboration:skripsi
container_name: letscode-collaboration
restart: always
ports:
- "${COLLABORATION_PORT}:6002"
environment:
PORT: 6002
DATABASE_URL: ${MONGODB_URL}
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: ${RABBITMQ_USER}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
JUDGE_API_URL: ${JUDGE_API_URL}
JUDGE_API_HOST: ${JUDGE_API_HOST}
problem:
build:
context: ./be/problem
dockerfile: Dockerfile
image: letscode-problem:skripsi
container_name: letscode-problem
restart: always
ports:
- "${PROBLEM_PORT}:6003"
environment:
PORT: 6003
SECRET: ${JWT_SECRET}
DATABASE_URL: ${MONGODB_URL}
SUPER_ID: ${SUPER_ID}
mailer:
depends_on:
- rabbitmq
build:
context: ./be/mailer
dockerfile: Dockerfile
image: letscode-mailer:skripsi
container_name: letscode-mailer
restart: always
environment:
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: ${RABBITMQ_USER}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
OAUTH_EMAIL: ${OAUTH_EMAIL}
OAUTH_REFRESH_TOKEN: ${OAUTH_REFRESH_TOKEN}
OAUTH_ACCESS_TOKEN: ${OAUTH_ACCESS_TOKEN}
OAUTH_CLIENT_SECRET: ${OAUTH_CLIENT_SECRET}
OAUTH_CLIENT_ID: ${OAUTH_CLIENT_ID}
OAUTH_CODE: ${OAUTH_CODE}
submission1:
depends_on:
- rabbitmq
build:
context: ./be/submission
dockerfile: Dockerfile
image: letscode-submission:skripsi
container_name: letscode-submission1
restart: always
environment:
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: ${RABBITMQ_USER}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
DATABASE_URL: ${MONGODB_URL}
JUDGE_API_URL: ${JUDGE_API_URL}
JUDGE_API_HOST: ${JUDGE_API_HOST}
submission2:
depends_on:
- rabbitmq
build:
context: ./be/submission
dockerfile: Dockerfile
image: letscode-submission:skripsi
container_name: letscode-submission2
restart: always
environment:
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: ${RABBITMQ_USER}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
DATABASE_URL: ${MONGODB_URL}
JUDGE_API_URL: ${JUDGE_API_URL}
JUDGE_API_HOST: ${JUDGE_API_HOST}
submission3:
depends_on:
- rabbitmq
build:
context: ./be/submission
dockerfile: Dockerfile
image: letscode-submission:skripsi
container_name: letscode-submission3
restart: always
environment:
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: ${RABBITMQ_USER}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
DATABASE_URL: ${MONGODB_URL}
JUDGE_API_URL: ${JUDGE_API_URL}
JUDGE_API_HOST: ${JUDGE_API_HOST}
gateway:
build:
context: ./be/gateway
dockerfile: Dockerfile
image: letscode-gateway:skripsi
container_name: letscode-gateway
restart: always
ports:
- "5000:6000"
environment:
PORT: 6000
AUTH_URL: http://auth:6001
COLLABORATION_URL: http://collaboration:6002
PROBLEM_URL: http://problem:6003
y-websocket:
build:
context: ./be/websocket
dockerfile: Dockerfile
image: letscode-y-websocket:skripsi
container_name: letscode-y-websocket
restart: always
ports:
- "${WEBSOCKET_PORT}:${WEBSOCKET_PORT}"
environment:
PORT: ${WEBSOCKET_PORT}
# web:
# depends_on:
# - gateway
# - auth
# - problem
# - collaboration
# - submission1
# - submission2
# - submission3
# - mailer
# - y-websocket
# - rabbitmq
# build:
# context: ./fe
# image: letscode-web:skripsi
# restart: always
# container_name: letscode-web
# ports:
# - "3000:3000"
volumes:
postgres-data:
redis-data:
rabbitmq-data:
letscode-mongodb:
user-data:
# mongodb:
# image: mongo
# container_name: letscode-mongodb
# ports:
# - 7017:27017
# volumes:
# - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
# - letscode-mongodb:/data/db
# environment:
# MONGO_INITDB_DATABASE: letscode
# MONGO_INITDB_ROOT_USERNAME: mimin
# MONGO_INITDB_ROOT_PASSWORD: 123456