1

All of the tutorials online say to manually start elasticsearch as a daemon with a docker command from the command line. Is there a way to auto run it like redis, postgres and other services do from the docker compose yaml file?

2
  • I found a script in bin/docker-start.sh that I added some code to. I am still experimenting with it.
    – Natus Drew
    Commented Jul 26, 2017 at 7:29
  • you can easily use the example from hub.docker.com/_/elasticsearch to run the elasticsearch using docker compose Commented Aug 2, 2017 at 1:52

1 Answer 1

1

https://github.com/elastic/stack-docker/blob/master/docker-compose.yml

This is an official docker-compose for running Elasticsearch, and will make a good starting point for whatever you're trying to achieve. This would be the key part:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
    environment: ['http.host=0.0.0.0', 'transport.host=127.0.0.1', 'ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
    ports: ['127.0.0.1:9200:9200']
    networks: ['stack']

But I'd recommend cloning the entire repository locally and running docker-compose up to experiment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.