services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:8.12.2 container_name: elasticsearch restart: unless-stopped ports: - '9200:9200' - '9300:9300' networks: - nice-net environment: - node.name=elasticsearch-node-1 - cluster.name=fenghuo-cluster - discovery.type=single-node - bootstrap.memory_lock=true - xpack.security.enabled=true - xpack.security.http.ssl.enabled=false - xpack.security.transport.ssl.enabled=false - ELASTIC_PASSWORD=Letusdoit000 - 'ES_JAVA_OPTS=-Xms1g -Xmx1g' ulimits: memlock: soft: -1 hard: -1 volumes: - ./volumes/elasticsearch/data:/usr/share/elasticsearch/data - ./volumes/elasticsearch/logs:/usr/share/elasticsearch/logs healthcheck: test: ['CMD-SHELL', 'curl -s -u elastic:Letusdoit000 http://localhost:9200/_cluster/health | grep -v "\"status\":\"red\""'] interval: 30s timeout: 10s retries: 3 start_period: 120s deploy: resources: limits: memory: 2G cpus: '2.0' sysctls: - vm.max_map_count=262144