version: '3.0'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.9.1
    container_name: elasticsearch
    environment:
      - discovery.type=single-node
      - "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
      - bootstrap.memory_lock=true
      - xpack.ml.enabled=true
      - xpack.monitoring.enabled=true
      - xpack.security.enabled=false
      - xpack.watcher.enabled=true
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ./es-data:/usr/share/elasticsearch/data
    ports:
      - 9200:9200

  kibana:
    image: docker.elastic.co/kibana/kibana:7.9.1
    container_name: kibana
    environment:
      - xpack.ml.enabled=true
      - xpack.monitoring.enabled=true
      - xpack.reporting.enabled=true
      - xpack.security.enabled=false
      - xpack.monitoring.report_stats=true
      - xpack.monitoring.ui.enabled=true
    links:
      - elasticsearch:elasticsearch
    ports:
      - 5601:5601

volumes:
  es-data:
    driver: local
