-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.es.yml
More file actions
34 lines (32 loc) · 1.05 KB
/
Copy pathdocker-compose.es.yml
File metadata and controls
34 lines (32 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 本地开发:仅 Elasticsearch(暴露 9200,与 .env 默认 ES_NODE 一致)
# 用法:docker compose -f docker-compose.es.yml up -d
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.0
container_name: uburnode-es-local
ports:
- "9200:9200"
environment:
discovery.type: single-node
xpack.security.enabled: "false"
ES_JAVA_OPTS: -Xms512m -Xmx512m
# Elasticvue 等浏览器 UI 跨域访问 localhost:9200 需要开启 CORS
http.cors.enabled: "true"
http.cors.allow-origin: '"*"'
http.cors.allow-headers: "X-Requested-With,Content-Type,Content-Length,Authorization"
http.cors.allow-credentials: "true"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- es_data_local:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl -sf http://127.0.0.1:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 5s
retries: 12
start_period: 40s
restart: unless-stopped
volumes:
es_data_local: