Skip to content

Latest commit

 

History

History
55 lines (31 loc) · 1.64 KB

docker_setup.rst

File metadata and controls

55 lines (31 loc) · 1.64 KB

Getting Elasticsearch Up and Running Locally With Docker

.. index:: Docker

The steps below will get you up and running elasticsearch in a local development environment. All of these commands assume you are in the project root.

Prerequisites

Build the Stack (currently unnecessary)

Currently, the dev stack consists of prebuilt images. In the future, if custom docker images are added to the compose file, this may be necessary:

$ docker-compose build --no-cache

Run the Stack

This brings up Elasticsearch. The first time it is run it might take a while to get started, but subsequent runs will occur quickly.

Open a terminal at the project root and run the following for local development:

$ docker-compose up

To rebuild the stack after docker-compose build --no-cache, run this first:

$ docker-compose down

To run the psql shell for postgres:

$ docker-compose exec db psql "postgresql://pguser:pgpass@localhost/pgdb"

Tips & Tricks

Activate a Docker Machine

This tells our computer that all future commands are specifically for the dev1 machine. Using the eval command we can switch machines as needed.:

$ eval "$(docker-machine env dev1)"