version: '3' services: kafka: image: confluentinc/cp-kafka:5.0.1 environment: - KAFKA_ZOOKEEPER_CONNECT=zookeeper:32181 - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:29092 - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 ports: - 29092:29092 depends_on: - zookeeper zookeeper: image: confluentinc/cp-zookeeper:5.0.1 environment: - ZOOKEEPER_CLIENT_PORT=32181 - ZOOKEEPER_TICK_TIME=2000 - ZOOKEEPER_SYNC_LIMIT=2 expose: - 32181/tcp ports: - 32181:32181