-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
335 lines (317 loc) · 9.98 KB
/
docker-compose.yaml
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
version: '3.9'
services:
teacher_web:
container_name: teacher_web
build:
context: ./infra/docker/web/teacher
dockerfile: Dockerfile.development
working_dir: /var/web
volumes:
- ./web/teacher:/var/web:cached
ports:
- 3000:3000
environment:
- API_URL=${TEACHER_API_URL}
- FIREBASE_API_KEY=${FIREBASE_API_KEY}
- FIREBASE_PROJECT_ID=${FIREBASE_PROJECT_ID}
- FIREBASE_MESSAGING_SENDER_ID=${FIREBASE_MESSAGING_SENDER_ID}
command: yarn dev -H 0.0.0.0 -p 3000
student_web:
container_name: student_web
build:
context: ./infra/docker/web/student
dockerfile: Dockerfile.development
working_dir: /var/web
volumes:
- ./web/student:/var/web:cached
ports:
- 3010:3000
environment:
- API_URL=${STUDENT_API_URL}
- FIREBASE_API_KEY=${FIREBASE_API_KEY}
- FIREBASE_PROJECT_ID=${FIREBASE_PROJECT_ID}
- FIREBASE_MESSAGING_SENDER_ID=${FIREBASE_MESSAGING_SENDER_ID}
command: yarn dev -H 0.0.0.0 -p 3000
teacher_gateway:
container_name: teacher_gateway
build:
context: .
dockerfile: ./infra/docker/api/gateway/teacher/Dockerfile.development
working_dir: /go/src/github.com/calmato/shs-web/api
volumes:
- ./api:/go/src/github.com/calmato/shs-web/api:cached
- ./tmp/data/go/pkg/mod:/go/pkg/mod:delegated
- ./tmp/logs/gateway/teacher:/var/log/api:delegated
environment:
- PORT=8080
- METRICS_PORT=9090
- SHUTDOWN_DELAY_SEC=0
- LOG_PATH=/var/log/api
- GCP_SERVICE_KEY_JSON=${GCP_SERVICE_KEY_JSON}
- GCP_STORAGE_BUCKET_NAME=${GCP_STORAGE_BUCKET_NAME}
- CLASSROOM_SERVICE_URL=classroom_api:8080
- LESSON_SERVICE_URL=lesson_api:8080
- USER_SERVICE_URL=user_api:8080
ports:
- 18000:8080
- 18001:9090
command: make dev SERVICE=gateway/teacher
student_gateway:
container_name: student_gateway
build:
context: .
dockerfile: ./infra/docker/api/gateway/student/Dockerfile.development
working_dir: /go/src/github.com/calmato/shs-web/api
volumes:
- ./api:/go/src/github.com/calmato/shs-web/api:cached
- ./tmp/data/go/pkg/mod:/go/pkg/mod:delegated
- ./tmp/logs/gateway/student:/var/log/api:delegated
environment:
- PORT=8080
- METRICS_PORT=9090
- SHUTDOWN_DELAY_SEC=0
- LOG_PATH=/var/log/api
- GCP_SERVICE_KEY_JSON=${GCP_SERVICE_KEY_JSON}
- GCP_STORAGE_BUCKET_NAME=${GCP_STORAGE_BUCKET_NAME}
- CLASSROOM_SERVICE_URL=classroom_api:8080
- LESSON_SERVICE_URL=lesson_api:8080
- USER_SERVICE_URL=user_api:8080
ports:
- 18010:8080
- 18011:9090
command: make dev SERVICE=gateway/student
user_api:
container_name: user_api
build:
context: .
dockerfile: ./infra/docker/api/user/server/Dockerfile.development
working_dir: /go/src/github.com/calmato/shs-web/api
volumes:
- ./api:/go/src/github.com/calmato/shs-web/api:cached
- ./tmp/data/go/pkg/mod:/go/pkg/mod:delegated
- ./tmp/logs/api/user:/var/log/api:delegated
environment:
- PORT=8080
- METRICS_PORT=9090
- SHUTDOWN_DELAY_SEC=0
- LOG_PATH=/var/log/api
- GCP_SERVICE_KEY_JSON=${GCP_SERVICE_KEY_JSON}
- GCP_STORAGE_BUCKET_NAME=${GCP_STORAGE_BUCKET_NAME}
- DB_HOST=mysql
- DB_PORT=3306
- DB_USERNAME=root
- DB_PASSWORD=${MYSQL_ROOT_PASSWORD}
ports:
- 19000:8080
- 19001:9090
command: make dev SERVICE=user/server
classroom_api:
container_name: classroom_api
build:
context: .
dockerfile: ./infra/docker/api/classroom/server/Dockerfile.development
working_dir: /go/src/github.com/calmato/shs-web/api
volumes:
- ./api:/go/src/github.com/calmato/shs-web/api:cached
- ./tmp/data/go/pkg/mod:/go/pkg/mod:delegated
- ./tmp/logs/api/classroom:/var/log/api:delegated
environment:
- PORT=8080
- METRICS_PORT=9090
- SHUTDOWN_DELAY_SEC=0
- LOG_PATH=/var/log/api
- DB_HOST=mysql
- DB_PORT=3306
- DB_USERNAME=root
- DB_PASSWORD=${MYSQL_ROOT_PASSWORD}
- USER_SERVICE_URL=user_api:8080
ports:
- 19010:8080
- 19011:9090
command: make dev SERVICE=classroom/server
lesson_api:
container_name: lesson_api
build:
context: .
dockerfile: ./infra/docker/api/lesson/server/Dockerfile.development
working_dir: /go/src/github.com/calmato/shs-web/api
volumes:
- ./api:/go/src/github.com/calmato/shs-web/api:cached
- ./tmp/data/go/pkg/mod:/go/pkg/mod:delegated
- ./tmp/logs/api/lesson:/var/log/api:delegated
environment:
- PORT=8080
- METRICS_PORT=9090
- SHUTDOWN_DELAY_SEC=0
- LOG_PATH=/var/log/api
- DB_HOST=mysql
- DB_PORT=3306
- DB_USERNAME=root
- DB_PASSWORD=${MYSQL_ROOT_PASSWORD}
- CLASSROOM_SERVICE_URL=classroom_api:8080
- USER_SERVICE_URL=user_api:8080
- MESSENGER_SERVICE_URL=messenger_api:8080
ports:
- 19020:8080
- 19021:9090
command: make dev SERVICE=lesson/server
messenger_api:
container_name: messenger_api
build:
context: .
dockerfile: ./infra/docker/api/messenger/server/Dockerfile.development
working_dir: /go/src/github.com/calmato/shs-web/api
volumes:
- ./api:/go/src/github.com/calmato/shs-web/api:cached
- ./tmp/data/go/pkg/mod:/go/pkg/mod:delegated
- ./tmp/logs/api/messenger:/var/log/api:delegated
environment:
- PORT=8080
- METRICS_PORT=9090
- SHUTDOWN_DELAY_SEC=0
- LOG_PATH=/var/log/api
- GCP_PROJECT_ID=project-dev
- PUBSUB_EMULATOR_HOST=pubsub:8085
- PUBSUB_TOPIC_ID=pubsub-messenger
- USER_SERVICE_URL=user_api:8080
- LESSON_SERVICE_URL=lesson_api:8080
ports:
- 19030:8080
- 19031:9090
command: make dev SERVICE=messenger/server
messenger_notifier:
container_name: messenger_notifier
build:
context: .
dockerfile: ./infra/docker/api/messenger/notifier/Dockerfile.development
working_dir: /go/src/github.com/calmato/shs-web/api
volumes:
- ./api:/go/src/github.com/calmato/shs-web/api:cached
- ./tmp/data/go/pkg/mod:/go/pkg/mod:delegated
- ./tmp/logs/api/lesson:/var/log/api:delegated
environment:
- METRICS_PORT=9090
- LOG_PATH=/var/log/api
- GCP_PROJECT_ID=project-dev
- PUBSUB_EMULATOR_HOST=pubsub:8085
- PUBSUB_SUBSCRIPTION_ID=pubsub-messenger
- SENDGRID_API_KEY=${SENDGRID_API_KEY}
- SENDGRID_TEMPLATE_PATH=./config/messenger/notifier/dev.yaml
- MAIL_FROM_NAME=${MAIL_FROM_NAME}
- MAIL_FROM_ADDRESS=${MAIL_FROM_ADDRESS}
- TEACHER_WEB_URL=http://127.0.0.1:3000
- STUDENT_WEB_URL=http://127.0.0.1:3010
- USER_SERVICE_URL=user_api:8080
command: make dev SERVICE=messenger/notifier
depends_on:
- pubsub
pubsub:
container_name: pubsub
platform: linux/x86_64
build:
context: ./infra/docker/infra/pubsub
dockerfile: Dockerfile
ports:
- 8090:8085
mysql:
container_name: mysql
platform: linux/x86_64
build:
context: ./infra/docker/infra/mysql
dockerfile: Dockerfile
volumes:
- ./infra/mysql/development.cnf:/etc/mysql/conf.d/my.cnf
- ./infra/mysql/schema:/docker-entrypoint-initdb.d
- ./tmp/logs/mysql:/var/log/mysql:delegated
- ./tmp/data/mysql:/var/lib/mysql:delegated
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
ports:
- 3316:3306
mysql_test:
container_name: mysql_test
platform: linux/x86_64
build:
context: ./infra/docker/infra/mysql
dockerfile: Dockerfile
volumes:
- ./infra/mysql/test.cnf:/etc/mysql/conf.d/my.cnf
- ./infra/mysql/schema:/docker-entrypoint-initdb.d
- ./tmp/logs/mysql_test:/var/log/mysql:delegated
- ./tmp/data/mysql_test:/var/lib/mysql:delegated
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
ports:
- 3326:3306
firebase_test:
container_name: firebase_test
platform: linux/x86_64
build:
context: ./infra/docker/infra/firebase
dockerfile: Dockerfile
working_dir: /var/firebase
volumes:
- ./infra/firebase:/var/firebase:cached
ports:
- 4000:4000
- 8080:8080
- 8085:8085
- 9099:9099
executor:
container_name: executor
build:
context: .
dockerfile: ./infra/docker/api/hack/Dockerfile
working_dir: /go/src/github.com/calmato/shs-web/api
volumes:
- ./api:/go/src/github.com/calmato/shs-web/api:cached
- ./infra:/go/src/github.com/calmato/shs-web/infra:cached
environment:
- DB_USERNAME=root
- DB_PASSWORD=${MYSQL_ROOT_PASSWORD}
proto:
container_name: proto
platform: linux/x86_64
build:
context: ./infra/docker/infra/proto
dockerfile: Dockerfile
working_dir: /go/src/github.com/calmato/shs-web
volumes:
- ./api:/go/src/github.com/calmato/shs-web/api:cached
- ./tmp/data/go/pkg/mod:/go/pkg/mod:delegated
swagger_generator:
container_name: swagger_generator
build:
context: ./infra/docker/infra/swagger/generator
dockerfile: Dockerfile
working_dir: /var/swagger
volumes:
- ./docs/swagger:/var/swagger:cached
- ./tmp/data/swagger:/tmp/data/swagger:cached
command: yarn watch
swagger_teacher:
container_name: swagger_ui_teacher
build:
context: ./infra/docker/infra/swagger/teacher
dockerfile: Dockerfile
volumes:
- ./tmp/data/swagger/teacher/openapi:/var/swagger:cached
ports:
- 9000:8080
environment:
SWAGGER_JSON: /var/swagger/openapi.yaml
depends_on:
- swagger_generator
swagger_student:
container_name: swagger_ui_student
build:
context: ./infra/docker/infra/swagger/student
dockerfile: Dockerfile
volumes:
- ./tmp/data/swagger/student/openapi:/var/swagger:cached
ports:
- 9010:8080
environment:
SWAGGER_JSON: /var/swagger/openapi.yaml
depends_on:
- swagger_generator