DEV Community

abhishekjaindba
abhishekjaindba

Posted on

Docker Compose For Elasticserach with Persistent Volume

To create a Docker Compose file for Elasticsearch with a persistent volume, you can use the volumes and volume_driver options in the elasticsearch service configuration. Here is an example docker-compose.yml file:​

version: '3.7'

services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.1
volumes:
- data:/usr/share/elasticsearch/data
environment:
- node.name=elasticsearch
- cluster.name=elasticsearch
- discovery.seed_hosts=elasticsearch
- cluster.initial_master_nodes=elasticsearch

read full: https://thedbadmin.com/docker-compose-for-elasticserach-with-persistent-volume/#more-6564

Top comments (0)