github.com/segmentio/kafka-go@v0.4.48-0.20240318174348-3f6244eb34fd/examples/docker-compose.yaml (about)

     1  version: '2.3'
     2  services:
     3  
     4    zookeeper:
     5      hostname: zookeeper
     6      image: bitnami/zookeeper:latest
     7      restart: always
     8      expose:
     9      - "2181"
    10      ports:
    11      - "2181:2181"
    12      environment:
    13        ALLOW_ANONYMOUS_LOGIN: yes
    14    
    15    kafka:
    16      hostname: kafka
    17      image: bitnami/kafka:2.7.0
    18      restart: always
    19      env_file:
    20      - kafka/kafka-variables.env
    21      depends_on:
    22      - zookeeper
    23      expose:
    24      - "9092"
    25      - "8082"
    26      - "8083"
    27      ports:
    28      - '9092:9092'
    29      - '8082:8082'
    30      - '8083:8083'
    31  
    32    mongo-db:
    33      image: mongo:4.0
    34      restart: always
    35      expose:
    36      - "27017"
    37      ports:
    38      - "27017:27017"
    39      environment:
    40        MONGO_DATA_DIR: /data/db
    41        MONGO_LOG_DIR: /dev/null
    42  
    43    consumer-mongo-db:
    44      build:
    45        context: consumer-mongo-db
    46      environment:
    47        mongoURL: mongodb://mongo-db:27017
    48        dbName: example_db
    49        collectionName: example_coll
    50        kafkaURL: kafka:9092
    51        topic: topic1
    52        GroupID: mongo-group
    53      depends_on: 
    54      - kafka
    55      - mongo-db
    56      restart: always
    57  
    58    consumer-logger:
    59      build:
    60        context: consumer-logger
    61      environment:
    62        kafkaURL: kafka:9092
    63        topic: topic1
    64        GroupID: logger-group
    65      depends_on: 
    66      - kafka
    67      restart: always
    68  
    69    producer-random:
    70      build:
    71        context: producer-random
    72      environment:
    73        kafkaURL: kafka:9092
    74        topic: topic1
    75      depends_on: 
    76      - kafka
    77      restart: always
    78  
    79    producer-api:
    80      build:
    81        context: producer-api
    82      environment:
    83        kafkaURL: kafka:9092
    84        topic: topic1
    85      expose:
    86      - "8080"
    87      ports:
    88      - "8080:8080"
    89      depends_on: 
    90      - kafka
    91      restart: always