zqyy-dockerfile/docker-compose.yml

40 lines
1.4 KiB
YAML
Raw Normal View History

services:
elasticsearch-hanlp:
image: zqyy/elasticsearch-hanlp:8.7.0
build:
context: ./src/zqyy/elasticsearch
dockerfile: Dockerfile
args:
ELASTIC_VERSION: "8.7.0"
container_name: zqyy-elasticsearch-hanlp
environment:
discovery.type: single-node
xpack.security.enabled: "false"
xpack.security.enrollment.enabled: "false"
ES_JAVA_OPTS: "-Xms1g -Xmx1g"
ports:
- "9200:9200"
- "9300:9300"
volumes:
- elasticsearch-hanlp-data:/usr/share/elasticsearch/data
# Optional: mount local dictionary/config files during development.
# Rebuild the image for production so every node uses the same files.
# - ./src/zqyy/elasticsearch/dictionaries/custom/zqyy-custom.txt:/usr/share/elasticsearch/plugins/analysis-hanlp/data/dictionary/custom/zqyy-custom.txt:ro
# - ./src/zqyy/elasticsearch/config/hanlp.properties:/usr/share/elasticsearch/config/analysis-hanlp/hanlp.properties:ro
# - ./src/zqyy/elasticsearch/config/hanlp-remote.xml:/usr/share/elasticsearch/config/analysis-hanlp/hanlp-remote.xml:ro
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65535
hard: 65535
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=1s >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 30
volumes:
elasticsearch-hanlp-data: