version: '2.2'

services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.5.1
    container_name: elasticsearch7
    environment:
      - node.name=es01
      - cluster.name=es-cluster751
      - discovery.seed_hosts=es01
      - cluster.initial_master_nodes=es01
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms16g -Xmx16g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    volumes:
      - /mnt/data/elasticsearch:/usr/share/elasticsearch/data:rw
    ports:
      - 9200:9200
    networks: 
      - elastic
  kibana:
    image: docker.elastic.co/kibana/kibana:7.5.1
    environment:
      SERVER_NAME: localhost
      ELASTICSEARCH_URL: http://localhost:9200
      XPACK_SECURITY_ENABLED: "false"
    container_name: kibana7
    ports:
      - 5601:5601
    depends_on:
      - elasticsearch
    networks:
      - elastic

networks:
  elastic:
    driver: bridge
