-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
287 lines (267 loc) · 7.15 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
version: '3.7'
networks:
awari-pipelines:
driver: bridge
ipam:
driver: default
config:
- subnet: "172.18.0.0/16"
gateway: "172.18.0.1"
# Settings and configurations that are common for all minio containers
x-minio-common: &minio-common
image: minio/minio:RELEASE.2023-02-22T18-23-45Z
command: server --console-address ":9001" http://minio{1...4}/data{1...2}
expose:
- "9000"
- "9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
# Settings dna configuration for apache-airflow
x-awari-airflow-common: &awari-airflow-common
build:
dockerfile: data/airflow/Dockerfile
# image: apache/airflow:2.5.1-python3.8
user: "${AIRFLOW_UID}:0"
env_file:
- data/airflow/.env
volumes:
- ./data/airflow/dags:/opt/airflow/dags
- ./data/airflow/logs:/opt/airflow/logs
- ./data/airflow/downloads:/opt/airflow/downloads
- ./data/airflow/plugins:/opt/airflow/plugins
- /var/run/docker.sock:/var/run/docker.sock
x-awari-airflow-depends-on: &awari-airflow-depends-on
depends_on:
awari-airflow-postgres:
condition: service_healthy
awari-airflow-init:
condition: service_completed_successfully
# starts 4 docker containers running minio server instances.
# using nginx reverse proxy, load balancing, you can access
# it through port 9000.
services:
minio1:
<<: *minio-common
hostname: minio1
volumes:
- ./data/minio/data1-1:/data1
- ./data/minio/data1-2:/data2
networks:
awari-pipelines:
ipv4_address: 172.18.0.16
minio2:
<<: *minio-common
hostname: minio2
volumes:
- ./data/minio/data2-1:/data1
- ./data/minio/data2-2:/data2
networks:
awari-pipelines:
ipv4_address: 172.18.0.17
minio3:
<<: *minio-common
hostname: minio3
volumes:
- ./data/minio/data3-1:/data1
- ./data/minio/data3-2:/data2
networks:
awari-pipelines:
ipv4_address: 172.18.0.18
minio4:
<<: *minio-common
hostname: minio4
volumes:
- ./data/minio/data4-1:/data1
- ./data/minio/data4-2:/data2
networks:
awari-pipelines:
ipv4_address: 172.18.0.19
awari-minio-nginx:
image: nginx:1.19.2-alpine
hostname: awari-nginx
volumes:
- ./data/minio/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "9000:9000"
- "9001:9001"
depends_on:
- minio1
- minio2
- minio3
- minio4
networks:
awari-pipelines:
ipv4_address: 172.18.0.20
awari-mongodb:
image: mongo:latest
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: rootpassword
ports:
- 27017:27017
volumes:
- ./data/mongodb/data:/data/db
networks:
awari-pipelines:
ipv4_address: 172.18.0.21
# Python service
python-app:
build:
dockerfile: data/python/Dockerfile
volumes:
- ./python-app:/home/awari/app
ports:
- "5001:5001"
networks:
- awari-pipelines
# Airflow Services
awari-airflow-postgres:
image: postgres:latest
container_name: awari-airflow-postgres
ports:
- "5434:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "airflow"]
interval: 5s
retries: 5
env_file:
- data/airflow/.env
volumes:
- ./data/airflow/postgres-data:/var/lib/postgresql/data
networks:
awari-pipelines:
ipv4_address: 172.18.0.110
awari-airflow-scheduler:
<<: *awari-airflow-common
<<: *awari-airflow-depends-on
container_name: awari-airflow-scheduler
command: scheduler
restart: on-failure
ports:
- "8793:8793"
networks:
awari-pipelines:
ipv4_address: 172.18.0.111
awari-airflow-webserver:
<<: *awari-airflow-common
<<: *awari-airflow-depends-on
container_name: awari-airflow-webserver
restart: always
command: webserver
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8080/health"]
interval: 30s
timeout: 30s
retries: 5
networks:
awari-pipelines:
ipv4_address: 172.18.0.112
awari-airflow-init:
<<: *awari-airflow-common
container_name: awari-airflow-init
entrypoint: /bin/bash
command:
- -c
- |
mkdir -p /sources/logs /sources/dags /sources/plugins /sources/downloads
chmod 777 -R /sources/downloads
chown -R "${AIRFLOW_UID}:0" /sources/{logs,dags,plugins,downloads}
exec /entrypoint airflow version
networks:
- awari-pipelines
# Postgreql Service
awari-postgres:
image: postgres:15.2-alpine3.17
container_name: awari-postgres
ports:
- "5431:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 5s
retries: 5
env_file:
- data/postgresql/.env
volumes:
- ./data/postgresql/data:/var/lib/postgresql/data
- ./data/postgresql/create-multiple-postgresql-databases.sh:/docker-entrypoint-initdb.d/01-create-db.sh
networks:
awari-pipelines:
ipv4_address: 172.18.0.6
# Jupyter Lab Service
awari-jupyterlab:
build:
dockerfile: data/jupyterlab/Dockerfile
volumes:
- ./jupyter-notebooks/:/notebooks
ports:
- "8888:8888"
- "20020:20020"
environment:
- JUPYTER_ENABLE_LAB=1
- SPARK_MASTER_IP=127.0.0.1
command: start-notebook.sh --NotebookApp.notebook_dir=/notebooks --NotebookApp.token='' --NotebookApp.password=''
networks:
awari-pipelines:
ipv4_address: 172.18.0.10
# Kafkta Services
awari-zookeeper:
image: wurstmeister/zookeeper:3.4.6
ports:
- "2181:2181"
networks:
awari-pipelines:
ipv4_address: 172.18.0.22
awari-kafka:
image: wurstmeister/kafka:2.13-2.8.1
ports:
- "9092:9092"
expose:
- "9093"
environment:
KAFKA_ADVERTISED_LISTENERS: INSIDE://awari-kafka:9093,OUTSIDE://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_ZOOKEEPER_CONNECT: awari-zookeeper:2181
networks:
awari-pipelines:
ipv4_address: 172.18.0.23
awari-kafka-ui:
image: provectuslabs/kafka-ui:v0.5.0
container_name: awari-kafka-ui
ports:
- "9099:8080"
environment:
- KAFKA_CLUSTERS_0_NAME=local
- KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=awari-kafka:9093
depends_on:
- awari-kafka
networks:
awari-pipelines:
ipv4_address: 172.18.0.24
#Metabase Service
metabase-app:
image: metabase/metabase:v0.45.3
restart: always
ports:
- 3001:3000
volumes:
# declare your mount volume /host/dir:/container/dir
- ./data/metabase/data:/metabase-data
env_file:
- ./data/metabase/.env
depends_on:
- awari-postgres
links:
- awari-postgres
networks:
awari-pipelines:
ipv4_address: 172.18.0.25