forked from wurstmeister/kafka-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-stack.yml
111 lines (97 loc) · 2.49 KB
/
docker-compose-stack.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
version: '3'
services:
kafka:
image: mcano/kafka:v1.0.0-0.10.2.0
env_file:
- config/kafka.properties
environment:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://$${HOSTNAME}:9092
KAFKA_BROKER_ID: -1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ZOOKEEPER_TIMEOUT_MS: 500
KAFKA_DELETE_TOPIC_ENABLED: "true"
KAFKA_AUTO_CREATE_TOPICS_ENABLED: "true"
JMX_PORT: 9999
KAFKA_CREATE_TOPICS: DEVICE_EVENTS:20:3,DECORATED_DEVICE_EVENTS:20:3,DECORATED_DEVICE_EVENTS_SORTED_PER_DEVICE:20:3
ports:
- 9092:9092
networks:
- kafka-stack-network
depends_on:
- zookeeper
deploy:
replicas: 3
resources:
limits:
cpus: "0.4"
memory: 800M
restart_policy:
condition: on-failure
zookeeper:
image: zookeeper:3.4
ports:
- 2181:2181
networks:
- kafka-stack-network
deploy:
replicas: 1
resources:
limits:
cpus: "0.1"
memory: 100M
restart_policy:
condition: on-failure
kafka-rest:
image: confluentinc/cp-kafka-rest:3.2.2
ports:
- 8082:8082
networks:
- kafka-stack-network
environment:
- KAFKA_REST_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_REST_ID=1
- KAFKA_REST_LISTENERS=http://0.0.0.0:8082/
- KAFKA_REST_HOST_NAME=kafka-rest
#command: ["bash", "-c" , "export KAFKA_REST_HOST_NAME=$${HOSTNAME} KAFKA_REST_ID=`echo $$HOSTNAME| sed -e s/[^0-9]//g|cut -c1-2` && exec /etc/confluent/docker/run"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8082"]
interval: 1m30s
timeout: 10s
retries: 3
depends_on:
- zookeeper
- kafka
deploy:
replicas: 1
restart_policy:
condition: on-failure
kafka-manager:
image: sheepkiller/kafka-manager:latest
ports:
- "9090:9000"
environment:
ZK_HOSTS: zookeeper:2181
APPLICATION_SECRET: letmein
KM_ARGS: -Djava.net.preferIPv4Stack=true
JMX_PORT: 9999
networks:
- kafka-stack-network
depends_on:
- zookeeper
deploy:
replicas: 1
restart_policy:
condition: on-failure
visualizer:
image: dockersamples/visualizer:stable
ports:
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
- kafka-stack-network
deploy:
placement:
constraints: [node.role == manager]
networks:
kafka-stack-network: