-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
95 lines (88 loc) · 2.18 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
version: '3'
services:
zookeeper:
image: zookeeper:3.6
environment:
ZOO_MY_ID: 1
ZOOKEEPER_CLIENT_PORT: 2181
healthcheck:
test: ["CMD", "echo", "ruok", "|", "nc", "localhost", "2181", "|", "grep", "imok"]
interval: 10s
timeout: 5s
retries: 5
networks:
- mynetwork
kafka_broker:
image: confluentinc/cp-kafka:latest
ports:
- "9092:9092"
- "29092:29092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka_broker:29092,EXTERNAL://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_LISTENERS: INTERNAL://0.0.0.0:29092,EXTERNAL://0.0.0.0:9092
KAFKA_LOG_RETENTION_HOURS: 720
KAFKA_LOG_RETENTION_BYTES: 100000000000
depends_on:
- zookeeper
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
mynetwork:
aliases:
- kafka_broker
kafka_producer:
build: ./kafka
env_file:
- ./.env
command: ["/wait-for-it.sh", "kafka_broker:29092", "--", "python3", "/app/kafka_producer.py"]
depends_on:
- kafka_broker
networks:
- mynetwork
spark:
build: ./spark
env_file:
- ./.env
depends_on:
- kafka_producer
networks:
- mynetwork
database:
build: ./database
ports:
- "3307:3306"
env_file:
- ./.env
image: mysql:8.2.0
volumes:
- mysql-data:/var/lib/mysql
networks:
- mynetwork
grafana:
build: ./grafana
ports:
- "3000:3000"
depends_on:
- database
env_file:
- ./.env
environment:
GF_AUTH_DISABLE_LOGIN_FORM: "false"
GF_AUTH_ANONYMOUS_ENABLED: "false"
GF_SESSION_PROVIDER: "memory" # Options: memory, database, redis, memcache
GF_USERS_ALLOW_SIGN_UP: "false"
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD}
volumes:
- grafana-data:/var/lib/grafana
networks:
- mynetwork
networks:
mynetwork:
volumes:
mysql-data:
grafana-data: