Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. version: '2'
  2.  
  3. services:
  4. zookeeper:
  5. image: confluentinc/cp-zookeeper:5.2.0
  6. hostname: zookeeper
  7. container_name: zookeeper
  8. ports:
  9. - '2181:2181'
  10. environment:
  11. ZOOKEEPER_CLIENT_PORT: 2181
  12. ZOOKEEPER_TICK_TIME: 2000
  13. extra_hosts:
  14. - "moby:127.0.0.1"
  15.  
  16. kafka:
  17. image: confluentinc/cp-kafka:5.2.0
  18. hostname: kafka
  19. container_name: kafka
  20. ports:
  21. - '9092:9092'
  22. depends_on:
  23. - zookeeper
  24. environment:
  25. KAFKA_BROKER_ID: 1
  26. KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
  27. KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
  28. KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
  29. KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
  30.  
  31. extra_hosts:
  32. - "moby:127.0.0.1"
  33.  
  34. schema-registry:
  35. image: confluentinc/cp-schema-registry:5.2.0
  36. hostname: schema-registry
  37. container_name: schema-registry
  38. depends_on:
  39. - zookeeper
  40. - kafka
  41. ports:
  42. - '9999:8081'
  43. environment:
  44. SCHEMA_REGISTRY_HOST_NAME: schema-registry
  45. SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:2181
  46. extra_hosts:
  47. - "moby:127.0.0.1"
  48.  
  49. kafka-create-topics:
  50. image: confluentinc/cp-kafka:5.2.0
  51. depends_on:
  52. - kafka
  53. hostname: kafka-create-topics
  54. command: "bash -c 'echo Waiting for Kafka to be ready... && \
  55. cub kafka-ready -b kafka:9092 1 20 && \
  56. kafka-topics --create --topic test --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 && \
  57. sleep infinity'"
  58. environment:
  59. KAFKA_BROKER_ID: ignored
  60. KAFKA_ZOOKEEPER_CONNECT: ignored
  61. extra_hosts:
  62. - "moby:127.0.0.1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement