Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM python:3
FROM python:3.8

# We'll add netcat cos it's a really useful
# network troubleshooting tool
RUN apt-get update
RUN apt-get install -y netcat

# Install the Confluent Kafka python library
RUN pip install confluent_kafka
RUN pip install -U pip confluent_kafka

# Add our script
ADD python_kafka_test_client.py /
Expand Down
22 changes: 11 additions & 11 deletions python/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
version: '3.5'

networks:
networks:
rmoff_kafka:
name: rmoff_kafka

services:
zookeeper:
image: confluentinc/cp-zookeeper:5.5.0
container_name: zookeeper
networks:
networks:
- rmoff_kafka
environment:
ZOOKEEPER_CLIENT_PORT: 2181

broker:
image: confluentinc/cp-kafka:5.5.0
container_name: broker
ports:
ports:
- "19092:19092"
networks:
networks:
- rmoff_kafka
depends_on:
- zookeeper
Expand All @@ -31,18 +31,18 @@ services:
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1

client:
image: python_kafka_test_client
build:
dockerfile: Dockerfile
container_name: python_kafka_test_client
depends_on:
depends_on:
- broker
networks:
networks:
- rmoff_kafka
entrypoint:
- bash
- -c
entrypoint:
- bash
- -c
- |
echo 'Giving Kafka a bit of time to start up…'
sleep 30
# Run the client code
python /python_kafka_test_client.py broker:9092

20 changes: 10 additions & 10 deletions python/docker-compose_initial.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
---
version: '3.5'

networks:
networks:
rmoff_kafka:
name: rmoff_kafka

services:
zookeeper:
image: confluentinc/cp-zookeeper:5.5.0
container_name: zookeeper
networks:
networks:
- rmoff_kafka
environment:
ZOOKEEPER_CLIENT_PORT: 2181

broker:
image: confluentinc/cp-kafka:5.5.0
container_name: broker
networks:
networks:
- rmoff_kafka
depends_on:
- zookeeper
Expand All @@ -28,18 +28,18 @@ services:
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1

client:
image: python_kafka_test_client
build:
dockerfile: Dockerfile
container_name: python_kafka_test_client
depends_on:
depends_on:
- broker
networks:
networks:
- rmoff_kafka
entrypoint:
- bash
- -c
entrypoint:
- bash
- -c
- |
echo 'Giving Kafka a bit of time to start up…'
sleep 30
# Run the client code
python /python_kafka_test_client.py broker:9092