Enterprise Search 8.x - Docker Compose example

Here is a simple way to start Enterprise Search (App Search and Workplace Search) with docker-compose .
File: docker-compose.yml

---
version: '3'
services:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:$ELASTIC_VERSION
    environment:
      - "discovery.type=single-node"
      # This one is just in case you are running low on disk space on your dev machine.
      - "cluster.routing.allocation.disk.threshold_enabled=false"
      - "xpack.security.authc.api_key.enabled=true"
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
      - "ELASTIC_PASSWORD=$ELASTIC_PASSWORD"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports: ['9200:9200']
    networks: ['stack']

  kibana:
    image: docker.elastic.co/kibana/kibana:$ELASTIC_VERSION
    ports: ['5601:5601']
    environment:
      - "ELASTICSEARCH_URL=http://elasticsearch:9200"
      - "ELASTICSEARCH_HOSTS=http://elasticsearch:9200"
      - "ENTERPRISESEARCH_HOST=http://enterprise_search:3002"
      - "ELASTICSEARCH_USERNAME=elastic"
      - "ELASTICSEARCH_PASSWORD=$ELASTIC_PASSWORD"
    networks: ['stack']
    links: ['elasticsearch']
    depends_on: ['elasticsearch']
    restart: always

  enterprise_search:
    image: docker.elastic.co/enterprise-search/enterprise-search:$ELASTIC_VERSION
    depends_on:
      - "elasticsearch"
    environment:
      - "ENT_SEARCH_DEFAULT_PASSWORD=$ELASTIC_PASSWORD"
      - "elasticsearch.username=elastic"
      - "elasticsearch.password=$ELASTIC_PASSWORD"
      - "elasticsearch.host=http://elasticsearch:9200"
      - "kibana.host=http://kibana:5601"
      - "allow_es_settings_modification=true"
      - "secret_management.encryption_keys=[4a2cd3f81d39bf28738c10db0ca782095ffac07279561809eecc722e0c20eb09]"
      - "JAVA_OPTS=-Xms2g -Xmx2g"
    ports: ['3002:3002']
    networks: ['stack']
    restart: always

networks:
  stack: {}

Settings

.env file is:

# Elastic Stack settings
ELASTIC_VERSION=8.0.0-alpha2
ELASTIC_PASSWORD=changeme

Starting the stack

To start the stack:

docker-compose up

Wait for everything to start. It could take several minutes:

Once started, you can open Kibana and connect with elastic / changeme account. From there, you can access the Enterprise Search management UI.

1 Like