Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save secretpray/fc508cafb73d09189cb2611ef1b3a1f4 to your computer and use it in GitHub Desktop.
Save secretpray/fc508cafb73d09189cb2611ef1b3a1f4 to your computer and use it in GitHub Desktop.
Elastic search in Docker of Rails 7 development

Universal docker method:

  1. start docker container:
docker run -d -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.17.8
  1. check Elasticsearch docker
curl http://localhost:9200

or in browser

localhost:9200
  1. in rails c
Post.reindex
  1. Stop Elasticsearch in docker container
docker ps -a -f status=running

--> find container_id for docker.elastic.co/elasticsearch/elasticsearch:7.17.8

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