-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdocker-compose.yml
101 lines (95 loc) · 4.54 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
# Docker compose file format 3.7 Required Docker Engine 18.06.0+
# For more information see: https://docs.docker.com/compose/compose-file/compose-versioning/
version: '3.7'
services:
# Confluent Kafka Docker image see: https://hub.docker.com/r/confluentinc/cp-kafka/
# Confluent Platform and Apache Kafka Compatibility:
# https://docs.confluent.io/current/installation/versions-interoperability.html
kafka:
image: confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION}
container_name: kafka
hostname: kafka
# Just in case Zookeeper isn't up yet restart
restart: always
environment:
# KAFKA_ADVERTISED_LISTENERS: comma-separated list of listeners with their the host/ip and port.
# This is the metadata that’s passed back to clients.
# LISTENER_DOCKER_INTERNAL: This will make Kafka accessible from outside of the Docker network (your machine) port: 9092.
# LISTENER_DOCKER_EXTERNAL: This will make Kafka accessible to other Docker containers by advertising it’s
# location on the Docker network port: 29092
KAFKA_LISTENERS: LISTENER_DOCKER_INTERNAL://:29092,LISTENER_DOCKER_EXTERNAL://:9092
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka:29092,LISTENER_DOCKER_EXTERNAL://localhost:9092
# Key/value pairs for the security protocol to use, per listener name
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
# The same ZooKeeper port is specified here as the previous container.
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
# The KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR is set to 1 for a single-node cluster. Unless you have three or more
# nodes you do not need to change this from the default.
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_DEFAULT_REPLICATION_FACTOR: 1
KAFKA_NUM_PARTITIONS: 3
# Whether or not to auto create topics when data is published for the first time to a topic
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
JMX_PORT: 9999
KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka -Dcom.sun.management.jmxremote.rmi.port=9999
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
CONFLUENT_SUPPORT_CUSTOMER_ID: 'anonymous'
KAFKA_AUTHORIZER_CLASS_NAME: kafka.security.authorizer.AclAuthorizer
KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: 'true'
EXTRA_ARGS: -javaagent:/usr/share/jmx-exporter/jmx_prometheus_javaagent-0.16.1.jar=1234:/usr/share/jmx-exporter/kafka_broker.yml
ports:
- 9092:9092
- 9999:9999
volumes:
- ${PWD}/monitoring/jmx-exporter/:/usr/share/jmx-exporter
depends_on:
- zookeeper
# Confluent Zookeeper Docker image see: https://hub.docker.com/r/confluentinc/cp-zookeeper/
zookeeper:
container_name: zookeeper
hostname: zookeeper
image: confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION}
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ports:
- 2181:2181
# Confluent Schema Registry Docker image see: https://hub.docker.com/r/confluentinc/cp-schema-registry
# Schema Registry: http://localhost:8081
schema-registry:
image: confluentinc/cp-schema-registry:${CONFLUENT_PLATFORM_VERSION}
hostname: schema-registry
container_name: schema-registry
restart: always
environment:
# Connects to the docker internal network port: 29092
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: "kafka:29092"
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_LISTENERS: "http://0.0.0.0:8081"
ports:
- 8081:8081
depends_on:
- zookeeper
kafka-ui:
image: provectuslabs/kafka-ui:latest
container_name: kafka-ui
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
KAFKA_CLUSTERS_0_JMXPORT: 9999
KAFKA_CLUSTERS_0_SCHEMAREGISTRY: "http://schema-registry:8081"
depends_on:
- kafka
ports:
- 9000:8080
# The zipkin process services the UI, and also exposes a POST endpoint that
# instrumentation can send trace data to. Scribe is disabled by default.
# Zipkin: http://localhost:9411
zipkin:
image: openzipkin/zipkin
container_name: zipkin
ports:
# Port used for the Zipkin UI and HTTP Api
- 9411:9411
environment:
JAVA_OPTS: "-Xms1024m -Xmx2048m -XX:+ExitOnOutOfMemoryError"