[REF] docker-compose

I’ve been doing a ton of integration work lately. Here’s a current copy of my “start everything locally” docker compose file.

version: '3.8'
services:

  zookeeper:
    image: strimzi/kafka:0.20.0-kafka-2.6.0
    command: [
      "sh", "-c", "bin/zookeeper-server-start.sh config/zookeeper.properties"
    ]
    ports:
      - "2181:2181"
    environment:
      LOG_DIR: /tmp/logs

  kafka:
    image: strimzi/kafka:0.20.0-kafka-2.6.0
    command: [
      "sh", "-c", "bin/kafka-server-start.sh config/server.properties --override listeners=$${KAFKA_LISTENERS} --override advertised.listeners=$${KAFKA_ADVERTISED_LISTENERS} --override zookeeper.connect=$${KAFKA_ZOOKEEPER_CONNECT}"
    ]
    depends_on:
      - zookeeper
    ports:
      - "9092:9092"
    environment:
      LOG_DIR: "/tmp/logs"
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
      KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181

  datagrid:
    image: registry.redhat.io/datagrid/datagrid-8-rhel8
    restart: always
    hostname: localhost
    ports:
      - "11222:11222"
    environment:
      - USER=local_test
      - PASS=password

  postgres:
    image: postgres
    restart: always
    ports:
      - "5432:5432"
    environment:
      POSTGRES_DB: root
      POSTGRES_USER: root
      POSTGRES_PASSWORD: password
    volumes: 
        - ./docker_postgres_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql

Leave a Reply

Your email address will not be published. Required fields are marked *