Skip to content

Instantly share code, notes, and snippets.

@sohangp
Last active October 2, 2019 17:23
Show Gist options
  • Save sohangp/d5d6f5aee87f6d74eb63df227dafbdff to your computer and use it in GitHub Desktop.
Save sohangp/d5d6f5aee87f6d74eb63df227dafbdff to your computer and use it in GitHub Desktop.
Docker Compose for Embedded Debizium
version: "3.5"
services:
# Install postgres and setup the student database.
postgres:
container_name: postgres
image: debezium/postgres
ports:
- 5432:5432
environment:
- POSTGRES_DB=studentdb
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
# Install zookeeper.
zookeeper:
container_name: zookeeper
image: zookeeper
ports:
- 2181:2181
# Install kafka and create needed topics.
kafka:
container_name: kafka
image: confluentinc/cp-kafka
hostname: kafka
ports:
- 9092:9092
- 29092:29092
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_HOST://kafka:29092
LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CREATE_TOPICS: "student_email_changed:1:1,student_enrolled:1:1"
depends_on:
- zookeeper
# Install debezium-connect.
debezium-connect:
container_name: custom-debezium-connect
image: custom-debezium-connect
hostname: debezium-connect
ports:
- '8083:8083'
environment:
GROUP_ID: 1
CONFIG_STORAGE_TOPIC: debezium_connect_config
OFFSET_STORAGE_TOPIC: debezium_connect_offsets
STATUS_STORAGE_TOPIC: debezium_connect_status
BOOTSTRAP_SERVERS: kafka:29092
depends_on:
- kafka
- postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment