version: "3.3"

services:

  postgres:
    image: postgres:14-alpine
    hostname: postgres_platform
    container_name: postgres_platform
    ports:
      - 5432:5432
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: open
      POSTGRES_DB: platform
      POSTGRES_PORT: 5432
    tmpfs: /var/lib/postgresql/data

  zookeeper:
    image: bitnami/zookeeper:3.7
    ports:
      - 2181:2181
    environment:
      ALLOW_ANONYMOUS_LOGIN: 1
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_TICK_TIME: 2000

  kafka:
    image: bitnami/kafka:2.8.1
    ports:
      - 9092:9092
    depends_on:
      - zookeeper
    links:
      - zookeeper
    environment:
      ALLOW_PLAINTEXT_LISTENER: 1
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_LOG4J_ROOT_LOGLEVEL: INFO
      KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.server=INFO"

