services:
elasticsearch:
image: elasticsearch:8.12.2
environment:
- discovery.type=single-node
- cluster.name=es-cluster-1
- node.name=es-node-1-1
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
- "xpack.security.enabled=true"
- "ELASTIC_USER=${ELASTIC_USER-elastic}"
- "ELASTIC_PASSWORD=${ELASTIC_PASSWORD-password1}"
ulimits:
memlock:
soft: -1
hard: -1
nproc: 65535
nofile:
soft: 65535
hard: 65535
logging:
driver: json-file
options:
max-size: "10m"
max-file: "100"
healthcheck:
test: ["CMD-SHELL", "curl -f -XGET 'localhost:9200/_cat/health?v' -u $ELASTIC_USER:$ELASTIC_PASSWORD | grep -q 'green'"]
interval: 1s
timeout: 15s
retries: 5000
ports:
- "9200:9200"
grpc-server:
build: .
depends_on:
elasticsearch:
condition: service_healthy
env_file:
- .env
ports:
- "50051:50051"