fenghuo/dockers/search-elasticsearch.yml

37 lines
902 B
YAML
Raw Normal View History

2025-05-26 21:45:30 +08:00
services:
elasticsearch:
2025-06-05 15:44:06 +08:00
image: docker.elastic.co/elasticsearch/elasticsearch:9.0.1
2025-05-26 21:45:30 +08:00
container_name: elasticsearch
restart: always
ports:
2025-05-27 09:18:05 +08:00
- '9200:9200'
- '9300:9300'
2025-05-26 21:45:30 +08:00
networks:
- nice-net
environment:
- discovery.type=single-node
- xpack.security.enabled=true
2025-06-05 15:44:06 +08:00
- ELASTIC_PASSWORD=nice_elastic_password
2025-05-27 09:18:05 +08:00
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
2025-05-26 21:45:30 +08:00
volumes:
- type: volume
source: elasticsearch_data
target: /usr/share/elasticsearch/data
2025-05-27 10:01:56 +08:00
- type: tmpfs
target: /tmp
tmpfs:
size: 1G
2025-05-26 21:45:30 +08:00
healthcheck:
test: curl -s http://localhost:9200/_cluster/health | grep -v '"status":"red"'
interval: 10s
timeout: 5s
retries: 3
volumes:
elasticsearch_data:
driver: local
driver_opts:
type: none
2025-06-05 15:44:06 +08:00
device: /opt/projects/nice/volumes/elasticsearch
2025-05-27 09:18:05 +08:00
o: bind