DEV Community

Cover image for Elastic container and persisting
Visakh Vijayan
Visakh Vijayan

Posted on • Updated on

Elastic container and persisting

Spent quite some time trying to persist data of elastic container to the host machine. Here is how to do it finally -

        container_name: elastic_db
        image: elasticsearch:7.6.2
            - "9200:9200"
            - discovery.type=single-node
            - "ES_JAVA_OPTS=-Xms400m -Xmx400m"
            - ./elastic-volume:/usr/share/elasticsearch/data:rw
Enter fullscreen mode Exit fullscreen mode

I have mapped the host folder elastic-volume over here. Give permissions to the folder so that it can be written into.

Hope this helps someone! :D

Top comments (0)