-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
279 lines (252 loc) · 10.5 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
version: '3.7'
volumes:
volume_adapter_db:
driver: local
volume_storage_db:
driver: local
volume_pipeline_db:
driver: local
volume_notification_db:
driver: local
services:
# ----------------- UI SERVICE (/ui) --------------------
ui:
image: docker.pkg.github.com/jvalue/open-data-service/ui:latest
labels:
- "traefik.enable=true"
- "traefik.http.routers.to-ui.rule=PathPrefix(`/`)"
- "traefik.http.services.ui.loadbalancer.server.port=80"
# ----------------- ADAPTER SERVICE (/adapter) --------------------
adapter:
image: docker.pkg.github.com/jvalue/open-data-service/adapter:latest
depends_on:
- adapter-db
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"
- "traefik.http.services.adapter.loadbalancer.server.port=8080"
adapter-db:
image: postgres
environment:
- POSTGRES_USER=adapterservice
- POSTGRES_PASSWORD=admin
volumes:
- volume_adapter_db:/var/lib/postgresql/data
# ----------------- SCHEDULER SERVICE (/scheduler) --------------------
scheduler:
image: docker.pkg.github.com/jvalue/open-data-service/scheduler:latest
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'
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.pkg.github.com/jvalue/open-data-service/storage-mq:latest
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
- 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"
- "traefik.http.services.storage-mq.loadbalancer.server.port=8080"
storage: # Wraps postgres database with API
image: docker.pkg.github.com/jvalue/open-data-service/storage:latest
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
labels:
- "traefik.enable=true"
- "traefik.http.routers.to-storage.rule=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
- "traefik.http.services.storage.loadbalancer.server.port=3000"
storage-db:
image: postgres:12-alpine
environment:
POSTGRES_DB: ods
POSTGRES_USER: ods_admin
POSTGRES_PASSWORD: ods_pw
volumes:
- volume_storage_db:/var/lib/postgresql/data
storage-db-liquibase: # perform database migration on start up
image: docker.pkg.github.com/jvalue/open-data-service/storage-db-liquibase:latest
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
storage-swagger: # API documentation for storage service
image: swaggerapi/swagger-ui
environment:
API_URL: http://localhost:9400/
# ----------------- PIPELINE SERVICE (/pipelines) --------------------
pipeline:
image: docker.pkg.github.com/jvalue/open-data-service/pipeline:latest
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"
- "traefik.http.services.pipeline.loadbalancer.server.port=8080"
pipeline-db:
image: postgres
environment:
POSTGRES_USER: 'pipeline-service'
POSTGRES_PASSWORD: 'pw'
POSTGRES_DB: 'ods-pipelines'
volumes:
- volume_pipeline_db:/var/lib/postgresql/data
# ----------------- NOTIFICATION SERVICE (/notification) --------------------
notification:
image: docker.pkg.github.com/jvalue/open-data-service/notification:latest
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"
- "traefik.http.services.notification.loadbalancer.server.port=8080"
notification-db:
image: postgres
environment:
POSTGRES_USER: 'notification_usr'
POSTGRES_PASSWORD: 'admin'
POSTGRES_DB: 'ods-notifications'
volumes:
- volume_notification_db:/var/lib/postgresql/data
# -------------------- EDGE SERVER (PORT 9000) -----------------------------
edge:
image: traefik:latest
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:management
environment:
RABBITMQ_ERLANG_COOKIE: 'S0m3_R4bBi7_C0ok13'
RABBITMQ_DEFAULT_USER: 'rabbit_adm'
RABBITMQ_DEFAULT_PASS: 'R4bb!7_4DM_p4SS'
labels:
- "traefik.enable=true"
- "traefik.http.routers.to-amqp.rule=PathPrefix(`/api/amqp`)"
- "traefik.http.routers.to-amqp.middlewares=amqp-stripprefix@docker"
- "traefik.http.middlewares.amqp-stripprefix.stripprefix.prefixes=/api/amqp"
- "traefik.http.services.amqp.loadbalancer.server.port=8080"
ports:
- "15672:15672"
- "5672:5672"