-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
260 lines (233 loc) · 6.68 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
version: '3.8' # Make sure to specify the version
services:
kafdrop:
image: obsidiandynamics/kafdrop
restart: "no"
ports:
- "9000:9000"
environment:
KAFKA_BROKERCONNECT: "kafka:29092"
depends_on:
- "kafka"
networks:
- localnet
kafka:
image: obsidiandynamics/kafka
restart: "no"
ports:
- "2181:2181"
- "9092:9092"
environment:
KAFKA_LISTENERS: "INTERNAL://0.0.0.0:29092,EXTERNAL://0.0.0.0:9092"
KAFKA_ADVERTISED_LISTENERS: "INTERNAL://kafka:29092,EXTERNAL://localhost:9092"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: "INTERNAL"
KAFKA_ZOOKEEPER_SESSION_TIMEOUT: "6000"
KAFKA_RESTART_ATTEMPTS: "10"
KAFKA_RESTART_DELAY: "5"
ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: "0"
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "9092"]
interval: 10s
timeout: 5s
retries: 5
networks:
- localnet
kafka-connect:
build:
context: .
dockerfile: Dockerfiles/Kafka-Connect/Dockerfile
ports:
- "35000:35000"
hostname: kafka-connect
container_name: kafka-connect
user: root
privileged: true
environment:
KAFKA_JMX_PORT: 35000
KAFKA_JMX_HOSTNAME: localhost
CONNECT_BOOTSTRAP_SERVERS: kafka:29092
CONNECT_REST_ADVERTISED_HOST_NAME: kafka-connect
CONNECT_REST_PORT: 8083
CONNECT_GROUP_ID: connect-cluster-group
CONNECT_CONFIG_STORAGE_TOPIC: docker-connect-configs
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
CONNECT_OFFSET_FLUSH_INTERVAL_MS: 10000
CONNECT_OFFSET_STORAGE_TOPIC: docker-connect-offsets
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
CONNECT_STATUS_STORAGE_TOPIC: docker-connect-status
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
CONNECT_ZOOKEEPER_CONNECT: "kafka:2181"
CONNECT_CONNECTIONS_MAX_IDLE_MS: 180000
CONNECT_METADATA_MAX_AGE_MS: 180000
CONNECT_AUTO_CREATE_TOPICS_ENABLE: "true"
CONNECT_KEY_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
depends_on:
- kafka
- mongodb
networks:
- localnet
entrypoint: ["/bin/bash", "-c", "/etc/confluent/docker/run"]
# Service Producteur Kafka
producer-weather:
build:
context: .
dockerfile: Dockerfiles/Producer-Weather/Dockerfile
restart: "no"
depends_on:
kibana:
condition: service_healthy
kafka:
condition: service_started
command: sh -c "python kibana.py & streamlit run producer_app.py --server.port 8501 --server.address 0.0.0.0"
ports:
- "8501:8501"
volumes:
- ./Sink-Connectors/mongo-sink-weather.json:/tmp/mongo-sink-weather.json
networks:
- localnet
producer-stock:
build:
context: .
dockerfile: Dockerfiles/Producer-Stock/Dockerfile
restart: "no"
depends_on:
kibana:
condition: service_healthy
kafka:
condition: service_started
command: sh -c "python kibana.py & streamlit run producer_app.py --server.port 8502 --server.address 0.0.0.0"
ports:
- "8502:8502"
volumes:
- ./Sink-Connectors/mongo-sink-stock.json:/tmp/mongo-sink-stock.json
networks:
- localnet
producer-log:
build:
context: .
dockerfile: Dockerfiles/Producer-Log/Dockerfile
restart: "no"
depends_on:
kibana:
condition: service_healthy
kafka:
condition: service_started
command: sh -c "python kibana.py & streamlit run producer_app.py --server.port 8503 --server.address 0.0.0.0"
ports:
- "8503:8503"
volumes:
- ./Sink-Connectors/mongo-sink-log.json:/tmp/mongo-sink-log.json
networks:
- localnet
mongodb:
image: mongodb/mongodb-enterprise-server:5.0-ubuntu2004
restart: always
ports:
- "27017:27017"
networks:
- localnet
volumes:
- mongodbdata:/data/db
mongo-exporter:
image: 'percona/mongodb_exporter:0.40.0'
environment:
MONGODB_URI: mongodb://mongodb:27017/kafka_topics
command: ["--collect-all", "--compatible-mode", "--discovering-mode"]
ports:
- 9216:9216
networks:
- localnet
grafana:
image: grafana/grafana
container_name: grafana
ports:
- 3000:3000
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
links:
- prometheus
volumes:
- ./Services/grafana/config/datasources:/etc/grafana/provisioning/datasources
- ./Services/grafana/config/dashboards:/etc/grafana/provisioning/dashboards
- ./Services/grafana/grafana_dashboards:/var/lib/grafana/dashboards
networks:
- localnet
depends_on:
- prometheus
prometheus:
image: prom/prometheus
container_name: prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
ports:
- 9090:9090
restart: unless-stopped
links:
- mongo-exporter
volumes:
- ./Services/prometheus:/etc/prometheus
networks:
- localnet
elasticsearch:
image: elasticsearch:7.10.1
environment:
- discovery.type=single-node
ports:
- "9200:9200"
networks:
- localnet
volumes:
- type: bind
source: ./Services/elasticsearch/config/elasticsearch.yml
target: /usr/share/elasticsearch/config/elasticsearch.yml
read_only: true
logstash:
build:
context: .
dockerfile: Dockerfiles/Logstash/Dockerfile
ports:
- "5044:5044"
volumes:
- ./Services/logstash/conf/mongodb.conf:/usr/share/logstash/pipeline/logstash.conf
networks:
- localnet
kibana:
environment:
- ELASTICSEARCH_HOSTS=http://elastic:elasticpass@elasticsearch:9200
image: kibana:7.8.1
container_name: kibana
build:
context: Services/kibana/
args:
ELK_VERSION: 7.6.2
ports:
- 5601:5601
volumes:
- type: bind
source: ./Services/kibana/config/kibana.yml
target: /usr/share/kibana/config/kibana.yml
read_only: true
networks:
- localnet
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5601"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
depends_on:
- elasticsearch
networks:
localnet:
driver: bridge
attachable: true
volumes:
mongodbdata:
elasticsearchdata:
prom_data: