Here is I'm setting that with docker compose ( docker-compose.yml
):
---
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:$ELASTIC_VERSION
environment:
- bootstrap.memory_lock=true
- discovery.type=single-node
- cluster.name=elasticsearch
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
- cluster.routing.allocation.disk.threshold_enabled=false
- ELASTIC_PASSWORD=$ELASTIC_PASSWORD
- xpack.security.enabled=$ELASTIC_SECURITY
ulimits:
memlock:
soft: -1
hard: -1
ports:
- 9200:9200
- 9300:9300
networks: ['stack']
kibana:
image: docker.elastic.co/kibana/kibana:$ELASTIC_VERSION
environment:
- ELASTICSEARCH_USERNAME=elastic
- ELASTICSEARCH_PASSWORD=$ELASTIC_PASSWORD
ports: ['5601:5601']
networks: ['stack']
links: ['elasticsearch']
depends_on: ['elasticsearch']
networks:
stack: {}
.env
file is:
ELASTIC_VERSION=7.1.0
ELASTIC_SECURITY=true
ELASTIC_PASSWORD=changeme
And if the context of integration tests with Maven:
HTH