Skip to content

Instantly share code, notes, and snippets.

@hvaandres
Created March 21, 2023 17:41
Show Gist options
  • Save hvaandres/1c863f12d3f9a123a34830a467ef06f1 to your computer and use it in GitHub Desktop.
Save hvaandres/1c863f12d3f9a123a34830a467ef06f1 to your computer and use it in GitHub Desktop.
Elastic_Search_Docker_Compose
version: '3.7'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0
container_name: elasticsearch
restart: always
environment:
- xpack.security.enabled=true
- xpack.security.authc.api_key.enabled=true
- discovery.type=single-node
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
volumes:
- elasticsearch-data-volume:/usr/share/elasticsearch/data
ports:
- 9200:9200
- 9300:9300
kibana:
container_name: kibana
image: docker.elastic.co/kibana/kibana:7.4.0
restart: always
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- 5601:5601
depends_on:
- elasticsearch
volumes:
elasticsearch-data-volume:
driver: local
@hvaandres
Copy link
Author

hvaandres commented Mar 21, 2023

If you would like to add a username or password:

environment:
  - xpack.security.enabled=true
  - xpack.security.authc.api_key.enabled=true
  - ELASTICSEARCH_USERNAME=<username>
  - ELASTICSEARCH_PASSWORD=<password>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment