-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
337 lines (317 loc) · 8.76 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
version: '3'
services:
postgres-airflow:
image: postgres
environment:
POSTGRES_PASSWORD: pssd
POSTGRES_USER : airflowuser
POSTGRES_DB : airflowdb
AIRFLOW_SCHEMA: airflow
expose:
- 5432
restart: always
volumes:
- ./postgres/scripts:/docker-entrypoint-initdb.d
# - ./sample_data:/sample_data
networks:
- common_network
postgres-dbt:
image: postgres
environment:
POSTGRES_PASSWORD: pssd
POSTGRES_USER : dbtuser
POSTGRES_DB : dbtdb
DBT_SCHEMA: dbt
DBT_RAW_DATA_SCHEMA: dbt_raw_data
expose:
- 5432
restart: always
volumes:
- ./sample_data:/sample_data
networks:
- common_network
airflow:
build: ./airflow/
restart: always
environment:
DBT_PROFILES_DIR: /dbt
AIRFLOW_HOME: /airflow
PYTHON_DEPS: flask-session==0.3.2
AIRFLOW__CORE__DAGS_FOLDER: /airflow/dags
AIRFLOW__CORE__PARALLELISM: 4
AIRFLOW__CORE__DAG_CONCURRENCY: 4
AIRFLOW__CORE__MAX_ACTIVE_RUNS_PER_DAG: 4
# AIRFLOW__ADMIN__HIDE_SENSITIVE_VARIABLE_FIELDS: False
# Postgres details need to match with the values defined in the postgres-airflow service
POSTGRES_USER: airflowuser
POSTGRES_PASSWORD: pssd
POSTGRES_HOST: postgres-airflow
POSTGRES_PORT: 5432
POSTGRES_DB: airflowdb
# postgres-dbt connection details. Required for the inital loading of seed data
# Credentials need to match with service postgres-dbt
DBT_POSTGRES_PASSWORD: pssd
DBT_POSTGRES_USER : dbtuser
DBT_POSTGRES_DB : dbtdb
DBT_DBT_SCHEMA: dbt
DBT_DBT_RAW_DATA_SCHEMA: dbt_raw_data
DBT_POSTGRES_HOST: postgres-dbt
depends_on:
- postgres-airflow
- postgres-dbt
ports:
- 8000:8080
volumes:
- ./dbt:/dbt
- ./airflow:/airflow
networks:
- common_network
adminer:
image: adminer
restart: always
ports:
- 8080:8080
depends_on:
- postgres-airflow
- postgres-dbt
networks:
- common_network
audit-service:
build: ./dapr/node
command: node audit-service.js
ports:
- "3000:3000"
- "9091:9091" # Add this line for app metrics
depends_on:
- redis
- placement
networks:
- common_network
audit-service-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "audit-service",
"-app-port", "3000",
"-components-path", "/components",
"-config", "/config/tracing.yaml",
"-metrics-port", "9093"] # Add this line for Dapr sidecar metrics
volumes:
- "./dapr/components/:/components"
- "./dapr/config/:/config"
depends_on:
- audit-service
network_mode: "service:audit-service"
airflow-trigger-service:
build: ./dapr/node
command: node airflow-trigger-service.js
ports:
- "3001:3001"
- "9095:9095" # Add this line for app metrics
depends_on:
- redis
- placement
networks:
- common_network
airflow-trigger-service-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "airflow-trigger-service",
"-app-port", "3001",
"-components-path", "/components",
"-config", "/config/tracing.yaml",
"-metrics-port", "9097"] # Add this line for Dapr sidecar metrics
volumes:
- "./dapr/components/:/components"
- "./dapr/config/:/config"
depends_on:
- airflow-trigger-service
network_mode: "service:airflow-trigger-service"
airflow-config-service:
build: ./dapr/node
command: node airflow-config-service.js
ports:
- "3002:3002"
- "9099:9099" # Add this line for app metrics
depends_on:
- redis
- placement
networks:
- common_network
airflow-config-service-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "airflow-config-service",
"-app-port", "3002",
"-components-path", "/components",
"-config", "/config/tracing.yaml",
"-metrics-port", "9101"] # Add this line for Dapr sidecar metrics
volumes:
- "./dapr/components/:/components"
- "./dapr/config/:/config"
depends_on:
- airflow-config-service
network_mode: "service:airflow-config-service"
management-service:
build: ./dapr/node
command: node management-service.js
ports:
- "3003:3003"
- "9103:9103" # Add this line for app metrics
depends_on:
- redis
- placement
networks:
- common_network
management-service-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "management-service",
"-app-port", "3003",
"-components-path", "/components",
"-config", "/config/tracing.yaml",
"-metrics-port", "9105"] # Add this line for Dapr sidecar metrics
volumes:
- "./dapr/components/:/components"
- "./dapr/config/:/config"
depends_on:
- management-service
network_mode: "service:management-service"
lineage-service:
build: ./dapr/node
command: node lineage-service.js
ports:
- "3004:3004" # Change this line
- "9107:9107"
depends_on:
- redis
- placement
networks:
- common_network
lineage-service-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "lineage-service",
"-app-port", "3004",
"-components-path", "/components",
"-config", "/config/tracing.yaml",
"-metrics-port", "9109"] # Add this line for Dapr sidecar metrics
volumes:
- "./dapr/components/:/components"
- "./dapr/config/:/config"
depends_on:
- lineage-service
network_mode: "service:lineage-service"
############################
# Python app + Dapr sidecar
############################
pythonapp:
environment:
PYTHONUNBUFFERED: 1
OTEL_EXPORTER_OTLP_ENDPOINT: "http://127.0.0.1:4317"
OTEL_RESOURCE_ATTRIBUTES: "service.name=pythonapp"
build: ./dapr/python
networks:
- common_network
ports:
- "8501:8501"
- "9092:9092"
- "9094:9094"
pythonapp-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "pythonapp",
"-placement-host-address", "placement:50006",
"-components-path", "/components",
"-config", "/config/tracing.yaml",
"-metrics-port", "9094"]
volumes:
- "./dapr/components/:/components"
- "./dapr/config/:/config"
depends_on:
- pythonapp
- otel-collector
network_mode: "service:pythonapp"
############################
# Dapr placement service
############################
placement:
image: "daprio/dapr"
command: ["./placement", "-port", "50006"]
ports:
- "50006:50006"
networks:
- common_network
############################
# Redis state store
############################
redis:
image: "redis:alpine"
ports:
- "6380:6379"
networks:
- common_network
############################
# Prometheus
############################
prometheus:
image: prom/prometheus
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
networks:
- common_network
############################
# Loki
############################
# loki:
# image: grafana/loki:2.2.1
# ports:
# - "3100:3100"
# networks:
# - common_network
# command: -config.file=/etc/loki/local-config.yaml
# volumes:
# - ./loki/local-config.yaml:/etc/loki/local-config.yaml
############################
# OpenTelemetry Collector
############################
otel-collector:
image: otel/opentelemetry-collector:latest
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./otel/otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
- "8888:8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- "13133:13133" # Health check extension
networks:
- common_network
healthcheck: # Add this healthcheck block
test: ["CMD", "wget", "--spider", "-q", "http://localhost:13133/"]
interval: 5s
timeout: 5s
retries: 5
############################
# Grafana
############################
grafana:
image: grafana/grafana
ports:
- "4000:3000"
networks:
- common_network
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning
- grafana-storage:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
restart: always
networks:
common_network:
volumes:
grafana-storage: