version: '3'

services:
  elasticsearch:
    container_name: elasticsearch
    image: docker.elastic.co/elasticsearch/elasticsearch:6.8.8
    environment:
      - bootstrap.memory_lock=true
      - cluster.name=docker-cluster-test
      - 'xpack.license.self_generated.type=basic'
      - 'xpack.security.enabled=true'
      - 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
    ulimits:
      memlock:
        soft: -1
        hard: -1
    networks:
      - bridge_es
    ports:
      - '9200:9200'
  kibana:
    container_name: kibana
    image: docker.elastic.co/kibana/kibana:6.8.8
    networks:
      - bridge_es
    ports:
      - '5601:5601'

networks:
  bridge_es:
    driver: bridge
    driver_opts:
      com.docker.network.bridge.name: bridge_es
