services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.13.0
    container_name: elasticsearch
    volumes:
      - esdata01:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    environment:
      - discovery.type=single-node
      - xpack.security.enabled=false
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"  # Increase Java heap size
      - cluster.routing.allocation.disk.watermark.low=90%
      - cluster.routing.allocation.disk.watermark.high=95%
      - cluster.routing.allocation.disk.watermark.flood_stage=99%
    deploy:
      resources:
        limits:
          cpus: '1.00'
          memory: 2g
        reservations:
          cpus: '0.50'
          memory: 1g
    restart: always
  
volumes:
  esdata01:
