version: '2'

services:
  elasticsearch:
    image: 'docker.elastic.co/elasticsearch/elasticsearch:6.6.2'
    restart: always
    container_name: elasticsearch
    hostname: elasticsearch
    environment:
      - cluster.name=elasticsearch
      - bootstrap.memory_lock=true
      - transport.host=localhost
      - "ES_JAVA_OPTS=-Xms512M -Xmx1G"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ./esdata:/usr/share/elasticsearch/data
    ports:
      - 9200:9200/tcp
    networks:
      mynet:
        ipv4_address: 172.118.0.101

networks:
  mynet:
    driver: bridge
    ipam:
      config:
      - subnet: 172.118.0.0/24

