forked from jvalue/ods
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
277 lines (250 loc) · 10.1 KB
/
docker-compose.yml
File metadata and controls
277 lines (250 loc) · 10.1 KB
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
# Service configurations for all microservices
# has to be specified by environment files
version: '3.7'
services:
# ----------------- UI SERVICE (/ui) --------------------
ui:
image: ${DOCKER_REGISTRY}/ui
build:
context: ./ui/
args:
UI_BASE_URL: /
ADAPTER_SERVICE_URL: /api/adapter
STORAGE_SERVICE_URL: /api/storage
PIPELINE_SERVICE_URL: /api/pipelines
NOTIFICATION_SERVICE_URL: /api/notification
SCHEMA_SERVICE_URL: /api/schema
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.to-ui.rule=PathPrefix(`/`)'
# ----------------- ADAPTER SERVICE (/adapter) --------------------
adapter:
image: ${DOCKER_REGISTRY}/adapter
build:
context: ./adapter/
depends_on:
- adapter-db
- rabbitmq
environment:
DB_URL: jdbc:postgresql://adapter-db:5432/adapterservice
RABBIT_HOST: rabbitmq
RABBIT_USR: rabbit_adm
RABBIT_PWD: R4bb!7_4DM_p4SS
RABBIT_PORT: 5672
AMQP_EXCHANGE: 'ods_global'
AMQP_IMPORT_SUCCESS_TOPIC: 'datasource.execution.success'
AMQP_IMPORT_FAILED_TOPIC: 'datasource.execution.failed'
AMQP_DATASOURCE_CREATED_TOPIC: 'datasource.config.created'
AMQP_DATASOURCE_UPDATED_TOPIC: 'datasource.config.updated'
AMQP_DATASOURCE_DELETED_TOPIC: 'datasource.config.deleted'
AMQP_PUBLISH_RETRIES: 5
AMQP_PUBLISH_BACKOFF: 1000
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.to-adapter.rule=PathPrefix(`/api/adapter`)'
- 'traefik.http.routers.to-adapter.middlewares=adapter-stripprefix@docker'
- 'traefik.http.middlewares.adapter-stripprefix.stripprefix.prefixes=/api/adapter'
adapter-db:
image: postgres:13-alpine
environment:
- POSTGRES_USER=adapterservice
- POSTGRES_PASSWORD=admin
# ----------------- SCHEDULER SERVICE (/scheduler) --------------------
scheduler:
image: ${DOCKER_REGISTRY}/scheduler
environment:
MAX_TRIGGER_RETRIES: 2
ADAPTER_SERVICE_URL: http://adapter:8080
CONNECTION_RETRIES: 20
CONNECTION_BACKOFF_IN_MS: 5000
AMQP_URL: 'amqp://rabbit_adm:R4bb!7_4DM_p4SS@rabbitmq:5672'
AMQP_SCHEDULER_EXCHANGE: 'ods_global'
AMQP_SCHEDULER_QUEUE: 'scheduler.datasource-config'
AMQP_DATASOURCE_CONFIG_TOPIC: 'datasource.config.*'
AMQP_DATASOURCE_CONFIG_CREATED_TOPIC: 'datasource.config.created'
AMQP_DATASOURCE_CONFIG_UPDATED_TOPIC: 'datasource.config.updated'
AMQP_DATASOURCE_CONFIG_DELETED_TOPIC: 'datasource.config.deleted'
build:
context: ./scheduler/
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.to-scheduler.rule=PathPrefix(`/api/scheduler`)'
- 'traefik.http.routers.to-scheduler.middlewares=scheduler-stripprefix@docker'
- 'traefik.http.middlewares.scheduler-stripprefix.stripprefix.prefixes=/api/scheduler'
depends_on:
- rabbitmq
# ----------------- STORAGE SERVICE (/storage) --------------------
storage-mq:
image: ${DOCKER_REGISTRY}/storage-mq
build: ./storage/storage-mq/
environment:
CONNECTION_RETRIES: 30
CONNECTION_BACKOFF_IN_MS: 2000
POSTGRES_HOST: storage-db
POSTGRES_PORT: 5432
POSTGRES_DB: ods
POSTGRES_USER: storagemq
POSTGRES_PW: storagemq-pw
POSTGRES_SCHEMA: 'storage'
AMQP_URL: 'amqp://rabbit_adm:R4bb!7_4DM_p4SS@rabbitmq:5672'
AMQP_PIPELINE_CONFIG_EXCHANGE: 'ods_global'
AMQP_PIPELINE_CONFIG_QUEUE: 'storage-mq.pipeline-config'
AMQP_PIPELINE_CONFIG_TOPIC: 'pipeline.config.*'
AMQP_PIPELINE_CONFIG_CREATED_TOPIC: 'pipeline.config.created'
AMQP_PIPELINE_CONFIG_DELETED_TOPIC: 'pipeline.config.deleted'
AMQP_PIPELINE_EXECUTION_EXCHANGE: 'ods_global'
AMQP_PIPELINE_EXECUTION_QUEUE: 'storage-mq.pipeline-execution'
AMQP_PIPELINE_EXECUTION_TOPIC: 'pipeline.execution.*'
AMQP_PIPELINE_EXECUTION_SUCCESS_TOPIC: 'pipeline.execution.success'
depends_on:
- storage-db
- storage-db-liquibase # TODO: make sure the migration runs through before reading db structure
- rabbitmq
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.to-storage-mq.rule=PathPrefix(`/api/storage-mq`)'
- 'traefik.http.routers.to-storage-mq.middlewares=storage-mq-stripprefix@docker'
- 'traefik.http.middlewares.storage-mq-stripprefix.stripprefix.prefixes=/api/storage-mq'
storage: # Wraps postgres database with API
image: ${DOCKER_REGISTRY}/storage
build: ./storage/postgrest/
environment:
DATABASE_HOST: storage-db
DATABASE_PORT: 5432
DATABASE_NAME: ods
DATABASE_USER: postgrest
DATABASE_PW: postgres-wrapper-pw
DATABASE_ANON: web_anon
depends_on:
- storage-db
- storage-db-liquibase # TODO: make sure the migration runs through before reading db structure
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.to-storage.rule=Path(`/api/storage`) || PathPrefix(`/api/storage/`)'
- 'traefik.http.routers.to-storage.middlewares=storage-stripprefix@docker,storage-addaccept@docker'
- 'traefik.http.middlewares.storage-stripprefix.stripprefix.prefixes=/api/storage'
- 'traefik.http.middlewares.storage-addaccept.headers.customrequestheaders.Accept=application/json' # Firefox Browser Support
storage-db:
image: postgres:13-alpine
environment:
POSTGRES_DB: ods
POSTGRES_USER: ods_admin
POSTGRES_PASSWORD: ods_pw
# Uncomment this if you want to persist the data.
# volumes:
# - './pgdata:/var/lib/postgresql/data'
# Uncomment this if you want to manage the Postgres databases with adminer
# adminer: # management UI for Postgres
# image: adminer
# ports:
# - 8080:8080
storage-db-liquibase: # perform database migration on start up
image: ${DOCKER_REGISTRY}/storage-db-liquibase
build: ./storage/liquibase/ # TODO: Sql Injection is currently
environment:
DATABASE_HOST: storage-db
DATABASE_PORT: 5432
DATABASE_NAME: ods
DATABASE_USER: ods_admin
DATABASE_PW: ods_pw
CONNECTION_RETRIES: 5
CONNECTION_BACKOFF_IN_SECONDS: 2
depends_on:
- storage-db
# ----------------- PIPELINE SERVICE (/pipelines) --------------------
pipeline:
image: ${DOCKER_REGISTRY}/pipeline
build:
context: ./pipeline/
depends_on:
- rabbitmq
- pipeline-db
environment:
CONNECTION_RETRIES: '30'
CONNECTION_BACKOFF_IN_MS: '2000'
POSTGRES_HOST: 'pipeline-db'
POSTGRES_PORT: 5432
POSTGRES_USER: 'pipeline-service'
POSTGRES_PW: 'pw'
POSTGRES_DB: 'ods-pipelines'
POSTGRES_SCHEMA: 'public' # other schemas have to be created somewhere before use!
AMQP_URL: 'amqp://rabbit_adm:R4bb!7_4DM_p4SS@rabbitmq:5672'
AMQP_PIPELINE_EXECUTION_EXCHANGE: 'ods_global'
AMQP_PIPELINE_EXECUTION_SUCCESS_TOPIC: 'pipeline.execution.success'
AMQP_PIPELINE_EXECUTION_ERROR_TOPIC: 'pipeline.execution.error'
AMQP_PIPELINE_CONFIG_CREATED_TOPIC: 'pipeline.config.created'
AMQP_PIPELINE_CONFIG_UPDATED_TOPIC: 'pipeline.config.updated'
AMQP_PIPELINE_CONFIG_DELETED_TOPIC: 'pipeline.config.deleted'
AMQP_DATASOURCE_EXECUTION_EXCHANGE: 'ods_global'
AMQP_DATASOURCE_EXECUTION_TOPIC: 'datasource.execution.*'
AMQP_DATASOURCE_EXECUTION_SUCCESS_TOPIC: 'datasource.execution.success'
AMQP_PIPELINE_EXECUTION_QUEUE: 'pipeline.pipeline-execution'
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.to-pipeline.rule=PathPrefix(`/api/pipelines`)'
- 'traefik.http.routers.to-pipeline.middlewares=pipeline-stripprefix@docker'
- 'traefik.http.middlewares.pipeline-stripprefix.stripprefix.prefixes=/api/pipelines'
pipeline-db:
image: postgres:13-alpine
environment:
POSTGRES_USER: 'pipeline-service'
POSTGRES_PASSWORD: 'pw'
POSTGRES_DB: 'ods-pipelines'
# ----------------- NOTIFICATION SERVICE (/notification) --------------------
notification:
image: ${DOCKER_REGISTRY}/notification
build:
context: ./notification/
environment:
# Postgres connection vars
POSTGRES_HOST: 'notification-db'
POSTGRES_PORT: 5432
POSTGRES_DB: 'ods-notifications'
POSTGRES_USER: 'notification_usr'
POSTGRES_PW: 'admin'
CONNECTION_RETRIES: 30
CONNECTION_BACKOFF_IN_MS: 2000
AMQP_URL: 'amqp://rabbit_adm:R4bb!7_4DM_p4SS@rabbitmq:5672'
AMQP_PIPELINE_EXECUTION_EXCHANGE: 'ods_global'
AMQP_PIPELINE_EXECUTION_QUEUE: 'notification.pipeline-execution'
AMQP_PIPELINE_EXECUTION_SUCCESS_TOPIC: 'pipeline.execution.success'
AMQP_NOTIFICATION_QUEUE: 'NOTIF_QUEUE'
NOTIFICATION_DATA_LOCATION_URL: 'http://localhost:9000/storage'
depends_on:
- notification-db
- rabbitmq
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.to-notification.rule=PathPrefix(`/api/notification`)'
- 'traefik.http.routers.to-notification.middlewares=notification-stripprefix@docker'
- 'traefik.http.middlewares.notification-stripprefix.stripprefix.prefixes=/api/notification'
notification-db:
image: postgres:13-alpine
environment:
POSTGRES_USER: 'notification_usr'
POSTGRES_PASSWORD: 'admin'
POSTGRES_DB: 'ods-notifications'
# -------------------- EDGE SERVER (PORT 9000) -----------------------------
edge:
image: traefik:2.3
command:
- --entrypoints.web.address=:80
- --providers.docker # enable label annotations in compose file
- --providers.docker.exposedByDefault=false
- --api.insecure # Dashboard: don't do that in production
# - --log.level=DEBUG
ports:
- '9000:80' # The HTTP port
- '9001:8080' # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
# -------------------- RABBIT-MQ -------------------------------------------
rabbitmq:
image: rabbitmq:3-management-alpine
environment:
RABBITMQ_ERLANG_COOKIE: 'S0m3_R4bBi7_C0ok13'
RABBITMQ_DEFAULT_USER: 'rabbit_adm'
RABBITMQ_DEFAULT_PASS: 'R4bb!7_4DM_p4SS'
ports:
- '15672:15672'
- '5672:5672'