forked from common-group/services-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
396 lines (371 loc) · 10.1 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
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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
version: "3"
volumes:
postgres-data:
driver: local
postgres-catarse-data:
driver: local
postgres-catarse-moments-data:
driver: local
dispatcher-redis-data:
driver: local
catarse-redis-data:
driver: local
networks:
cluster:
driver: bridge
ipam:
config:
- subnet: 10.0.1.0/26
services:
dispatcher_redis:
image: redis
volumes:
- dispatcher-redis-data:/var/lib/redis
command: redis-server --appendonly yes
networks:
cluster:
ipv4_address: 10.0.1.40
catarse_redis:
image: redis
volumes:
- catarse-redis-data:/var/lib/redis
command: redis-server --appendonly yes
networks:
cluster:
ipv4_address: 10.0.1.41
catarse_db:
image: library/postgres:9.4-alpine
volumes:
- ./services/service-core-db/init_catarse.sql:/docker-entrypoint-initdb.d/init.sql
- postgres-catarse-data:/var/lib/postgresql/data
ports:
- "5445:5432"
links:
- "service_core_db:service_core_db"
depends_on:
- service_core_db
environment:
POSTGRES_PASSWORD: example
POSTGRES_USER: catarse
POSTGRES_DB: catarse_db
networks:
cluster:
ipv4_address: 10.0.1.42
catarse_moments_db:
image: library/postgres:10.3-alpine
volumes:
- ./services/service-core-db/init_catarse_moments.sql:/docker-entrypoint-initdb.d/init.sql
- postgres-catarse-moments-data:/var/lib/postgresql/data
ports:
- "5446:5432"
links:
- "catarse_db:catarse_db"
depends_on:
- catarse_db
environment:
POSTGRES_PASSWORD: example
POSTGRES_USER: postgres
POSTGRES_DB: catarse_moments
networks:
cluster:
ipv4_address: 10.0.1.59
service_core_db:
image: library/postgres:9.6.5-alpine
volumes:
- ./services/service-core-db/init.sql:/docker-entrypoint-initdb.d/init.sql
- postgres-data:/var/lib/postgresql/data
ports:
- "5444:5432"
environment:
POSTGRES_PASSWORD: example
POSTGRES_USER: postgres
POSTGRES_DB: service_core
networks:
cluster:
ipv4_address: 10.0.1.43
# service just for apply migrations or seed
migrations:
build:
context: ./services/service-core-db/
dockerfile: Dockerfile
# image: comum/services-core:latest
env_file:
- ./compose_env/.service_core_migrator.env
command: ["./scripts/run_migrations.sh"]
volumes:
- ./services/service-core-db/migrations:/usr/app/migrations
links:
- "service_core_db:service_core_db"
networks:
cluster:
ipv4_address: 10.0.1.57
notification_dispatcher:
build:
context: ./services/notification-service-api
dockerfile: Dockerfile
env_file:
- ./compose_env/.notification_dispatcher.env
command: ["./dispatchers/notification_dispatcher"]
volumes:
- ./services/notification-service-api/:/usr/app
links:
- "service_core_db:service_core_db"
- "dispatcher_redis:dispatcher_redis"
depends_on:
- service_core_db
- dispatcher_redis
networks:
cluster:
ipv4_address: 10.0.1.44
payment_stream_processor:
build:
context: ./services/payment-service-api
dockerfile: Dockerfile
# image: comum/payment-service:latest
env_file:
- ./compose_env/.payment_stream_processor.env
command: ["./dispatchers/payment_stream_processor"]
volumes:
- ./services/payment-service-api/:/usr/app
links:
- "service_core_db:service_core_db"
- "dispatcher_redis:dispatcher_redis"
depends_on:
- service_core_db
- dispatcher_redis
networks:
cluster:
ipv4_address: 10.0.1.45
subscriptions_scheduler:
build:
context: ./services/payment-service-api
dockerfile: Dockerfile
env_file:
- ./compose_env/.subscriptions_scheduler.env
command: ["./scripts/subscription_scheduler.js"]
volumes:
- ./services/payment-service-api/:/usr/app
links:
- "service_core_db:service_core_db"
depends_on:
- service_core_db
networks:
cluster:
ipv4_address: 10.0.1.46
hook_service_api:
build:
context: ./services/hook-service-api
dockerfile: Dockerfile
env_file:
- ./compose_env/.hook_service_api.env
command: ["npm", "start", "server.js"]
volumes:
- ./services/hook-service-api/:/usr/app
links:
- "service_core_db:service_core_db"
depends_on:
- service_core_db
ports:
- "3006:4444"
networks:
cluster:
ipv4_address: 10.0.1.47
catarse:
build:
context: ./services/catarse
dockerfile: dev.Dockerfile
environment:
RAILS_ENV: development
DATABASE_URL: postgres://catarse:example@localhostcatarse:5432/catarse_db
REDIS_URL: redis://catarse_redis:6379
command: ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
volumes:
# mount volumes for development on catarse / catarse.js
- ./services/catarse/:/usr/app
- ./services/catarse.js/:/usr/app/node_modules/catarse.js
links:
- "catarse_db:localhostcatarse"
- "catarse_redis:catarse_redis"
depends_on:
- catarse_db
- catarse_redis
ports:
- "3000:3000"
networks:
cluster:
ipv4_address: 10.0.1.48
catarse_api:
image: postgrest/postgrest:v0.4.3.0
env_file:
- ./compose_env/.catarse_api.env
depends_on:
- catarse_db
links:
- "catarse_db:catarse_db"
ports:
- "3008:3000"
networks:
cluster:
ipv4_address: 10.0.1.49
payment_service_api:
image: postgrest/postgrest:v0.4.4.0
env_file:
- ./compose_env/.payment_service_api.env
depends_on:
- service_core_db
links:
- "service_core_db:service_core_db"
ports:
- "3001:3000"
networks:
cluster:
ipv4_address: 10.0.1.50
project_service_api:
image: postgrest/postgrest:v0.4.4.0
env_file:
- ./compose_env/.project_service_api.env
depends_on:
- service_core_db
links:
- "service_core_db:service_core_db"
ports:
- "3002:3000"
networks:
cluster:
ipv4_address: 10.0.1.51
community_service_api:
image: postgrest/postgrest:v0.4.4.0
env_file:
- ./compose_env/.community_service_api.env
depends_on:
- service_core_db
links:
- "service_core_db:service_core_db"
ports:
- "3003:3000"
networks:
cluster:
ipv4_address: 10.0.1.52
platform_service_api:
image: postgrest/postgrest:v0.4.4.0
env_file:
- ./compose_env/.platform_service_api.env
depends_on:
- service_core_db
links:
- "service_core_db:service_core_db"
ports:
- "3004:3000"
networks:
cluster:
ipv4_address: 10.0.1.53
analytics_service_api:
image: postgrest/postgrest:v0.4.4.0
env_file:
- ./compose_env/.analytics_service_api.env
depends_on:
- service_core_db
links:
- "service_core_db:service_core_db"
ports:
- "3005:3000"
networks:
cluster:
ipv4_address: 10.0.1.54
notification_service_api:
image: postgrest/postgrest:v0.4.4.0
env_file:
- ./compose_env/.notification_service_api.env
depends_on:
- service_core_db
links:
- "service_core_db:service_core_db"
ports:
- "3007:3000"
networks:
cluster:
ipv4_address: 10.0.1.55
recommender_service_api:
build:
context: ./services/catarse_recommender
dockerfile: catarse_recommender/Dockerfile
env_file:
- ./compose_env/.recommender_service_api.env
command: gunicorn -w 4 -b 0.0.0.0:3009 catarse_recommender.application:app
volumes:
- ./services/catarse_recommender/:/usr/app
depends_on:
- catarse_db
links:
- "catarse_db:catarse_db"
ports:
- "3009:3009"
networks:
cluster:
ipv4_address: 10.0.1.56
catarse_moment_service_api:
image: postgrest/postgrest:v0.4.4.0
env_file:
- ./compose_env/.catarse_moment_service_api.env
depends_on:
- catarse_moments_db
links:
- "catarse_moments_db:catarse_moments_db"
ports:
- "3010:3000"
networks:
cluster:
ipv4_address: 10.0.1.58
common_docs:
image: hrektts/mdbook
volumes:
- ./services/common/:/data
ports:
- "3011:3011"
- "3012:3012"
command: ["mdbook", "serve", "-p", "3011", "-w", "3012", "-i", "0.0.0.0"]
networks:
cluster:
ipv4_address: 10.0.1.60
common_proxy:
build:
context: ./services/proxy
dockerfile: Dockerfile
volumes:
- ./services/proxy/nginx.conf:/usr/local/openresty/nginx/confg/nginx.conf
- ./services/proxy/conf.d:/etc/nginx/conf.d
links:
- "payment_service_api:payment_service_api"
- "project_service_api:project_service_api"
- "community_service_api:community_service_api"
- "analytics_service_api:analytics_service_api"
- "catarse_moment_service_api:catarse_moment_service_api"
- "notification_service_api:notification_service_api"
- "recommender_service_api:recommender_service_api"
- "common_api:common_api"
- "service_core_db:service_core_db"
env_file:
- ./compose_env/.common_proxy.env
ports:
- "3013:80"
command: /bin/sh -c "envsubst '$$PORT $$PROTO_SCHEMA $$PAYMENT_SERVICE_API_SERVER $$PROJECT_SERVICE_API_SERVER $$COMMUNITY_SERVICE_API_SERVER $$ANALYTICS_SERVICE_API_SERVER $$NOTIFICATION_SERVICE_API_SERVER $$CATARSE_MOMENT_SERVICE_API_SERVER $$RECOMMENDER_SERVICE_API_SERVER $$COMMON_SERVICE_API_SERVER $$DNS_RESOLVER' < /etc/nginx/conf.d/proxy.template > /etc/nginx/conf.d/default.conf && openresty"
networks:
cluster:
ipv4_address: 10.0.1.61
common_api:
build:
context: ./services/common-api
dockerfile: Dockerfile
volumes:
- ./services/common-api:/app
- ./services/common_models:/common_models
links:
- "service_core_db:service_core_db"
env_file:
- ./compose_env/.common_api.env
ports:
- "3014:3000"
command: 'bundle exec rails s -b 0.0.0.0 -p 3000'
networks:
cluster:
ipv4_address: 10.0.1.62