-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
181 lines (168 loc) · 4.64 KB
/
docker-compose.yml
File metadata and controls
181 lines (168 loc) · 4.64 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
version: '3.9'
services:
jupyter-notebook-pyspark:
image: jupyter/pyspark-notebook:spark-3.4.1
ports:
- '8888:8888'
- '4040:4040'
volumes:
- ./iot_hub/infrastructure/data:/home/jovyan/work/data:rw
- ./iot_hub/infrastructure/jars:/home/jovyan/work/jars:rw
- ./iot_hub/infrastructure/jobs:/home/jovyan/work/jobs:rw
- ./iot_hub/infrastructure/notebooks:/home/jovyan/work/notebooks
- ./iot_hub/infrastructure/scripts:/home/jovyan/work/scripts:rw
user: root
environment:
- GRANT_SUDO=yes
- JUPYTER_TOKEN=tad
- SPARK_MASTER=spark://spark:7077
networks:
- spark-network
restart: on-failure
profiles:
- jupyter
spark:
image: docker.io/bitnami/spark:3.4.1
environment:
- SPARK_MODE=master
- SPARK_RPC_AUTHENTICATION_ENABLED=no
- SPARK_RPC_ENCRYPTION_ENABLED=no
- SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no
- SPARK_SSL_ENABLED=no
- GRANT_SUDO=yes
ports:
- '8080:8080'
- '7077:7077'
networks:
- spark-network
restart: on-failure
volumes:
- ./iot_hub/infrastructure/data:/home/jovyan/work/data:rw
- ./iot_hub/infrastructure/jars:/home/jovyan/work/jars:rw
- ./iot_hub/infrastructure/jobs:/home/jovyan/work/jobs:rw
user: root
spark-worker:
image: docker.io/bitnami/spark:3.4.1
environment:
- SPARK_MODE=worker
- SPARK_MASTER_URL=spark://spark:7077
- SPARK_WORKER_MEMORY=1G
- SPARK_WORKER_CORES=1
- SPARK_RPC_AUTHENTICATION_ENABLED=no
- SPARK_RPC_ENCRYPTION_ENABLED=no
- SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no
- SPARK_SSL_ENABLED=no
- GRANT_SUDO=yes
networks:
- spark-network
restart: on-failure
ports:
- '8081:8081'
volumes:
- ./iot_hub/infrastructure/data:/home/jovyan/work/data:rw
- ./iot_hub/infrastructure/jars:/home/jovyan/work/jars:rw
- ./iot_hub/infrastructure/jobs:/home/jovyan/work/jobs:rw
user: root
mariadb:
image: mariadb:10.7
ports:
- 3306:3306
volumes:
- "./iot_hub/infrastructure/config/mariadb:/var/lib/mysql"
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_PASSWORD=mysql
- MYSQL_USER=mysql
- MYSQL_DATABASE=data
restart: on-failure
networks:
- spark-network
kafka:
image: docker.io/bitnami/kafka:3.5
ports:
- "9092:9092"
- "9093:9093"
- "29092:29092"
volumes:
- "kafka_data:/bitnami"
user: root
environment:
- GRANT_SUDO=yes
# KRaft settings
- KAFKA_ADVERTISED_HOST_NAME=kafka
- KAFKA_CFG_NODE_ID=0
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093
# Listeners
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:29092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://localhost:29092
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT
networks:
- spark-network
- kafka-network
restart: on-failure
python-socket:
build:
context: ./iot_hub/infrastructure/.
ports:
- "1500:1500"
environment:
- SOCKET_PORT=1500
- BOOTSTRAP_SERVERS=kafka:9092
- WAIT_TIME=80
- KAFKA_TOPIC=iot_source
networks:
- kafka-network
restart: on-failure
depends_on:
- kafka
python-dashboard:
build:
context: ./analytics/.
ports:
- "8501:8501"
environment:
- MARIADB_HOST=mariadb
- MARIADB_USER=mysql
- MARIADB_PASSWORD=mysql
- MARIADB_DATABASE=data
- MARIADB_PORT=3306
networks:
- spark-network
restart: on-failure
depends_on:
- mariadb
flask-app:
hostname: flask-app
build:
context: ./iot_hub/webapp/.
restart: on-failure
network_mode: host
volumes:
- "./iot_hub/webapp/:/python-docker"
- "/var/run/docker.sock:/var/run/docker.sock"
crontab:
hostname: crontab
build:
context: ./iot_hub/infrastructure/cron/.
restart: on-failure
networks:
- spark-network
volumes:
- "./iot_hub/infrastructure/cron/logs:/var/log"
- "/var/run/docker.sock:/var/run/docker.sock"
- type: bind
source: ./docker-compose.yml
target: /home/docker-compose.yml
networks:
spark-network:
external: true
driver: bridge
kafka-network:
driver: bridge
volumes:
kafka_data:
driver: local