I used David's files exactly as is, simply copy/pasted into new files on my local computer and ran
docker-compose -f docker-compose.yml -f docker-compose-enterprise-search.yml up
I have found the following lines in the logs that suggest a problem when attempting to login as enterprise_search. However, I'm not sure how to fix it.
enterprisesearch_1 | [2020-12-07T02:56:51.687+00:00][1][2512][app-server][INFO]: [d315be3b-f601-4318-b644-d542a17a9d18] Started POST "/authenticate/sign_in" for 172.25.0.1 at 2020-12-07 02:56:51 +0000
enterprisesearch_1 | [2020-12-07T02:56:51.698+00:00][1][2512][action_controller][INFO]: [d315be3b-f601-4318-b644-d542a17a9d18] Processing by SharedTogo::AuthenticateController#login as */*
enterprisesearch_1 | [2020-12-07T02:56:51.699+00:00][1][2512][action_controller][INFO]: [d315be3b-f601-4318-b644-d542a17a9d18] Parameters: {"auth_strategy"=>"password", "user"=>{"email"=>"enterprise_search", "password"=>"[FILTERED]"}, "host"=>"localhost:3002", "protocol"=>"http"}
enterprisesearch_1 | [2020-12-07T02:56:51.703+00:00][1][2512][action_controller][WARN]: [d315be3b-f601-4318-b644-d542a17a9d18] Can't verify CSRF token authenticity
enterprisesearch_1 | [2020-12-07T02:56:51.705+00:00][1][2512][action_controller][INFO]: [d315be3b-f601-4318-b644-d542a17a9d18] Completed 422 Unprocessable Entity in 5ms
enterprisesearch_1 | [2020-12-07T02:56:51.714+00:00][1][2512][app-server][ERROR]: [d315be3b-f601-4318-b644-d542a17a9d18] Exception: ActionController::InvalidAuthenticityToken: ActionController::InvalidAuthenticityToken
enterprisesearch_1 | /usr/share/enterprise-search/lib/war/gems/gems/actionpack-4.2.11.3/lib/action_controller/metal/request_forgery_protection.rb:181:in `handle_unverified_request': ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken)
enterprisesearch_1 | from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-4.2.11.3/lib/action_controller/metal/request_forgery_protection.rb:209:in `handle_unverified_request'
enterprisesearch_1 | from /usr/share/enterprise-search/lib/war/gems/gems/devise-4.7.1/lib/devise/controllers/helpers.rb:255:in `handle_unverified_request'
enterprisesearch_1 | from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-4.2.11.3/lib/action_controller/metal/request_forgery_protection.rb:204:in `verify_authenticity_token'
docker-compose.yml
version: '3'
services:
elasticsearch:
image: $IMG_ELASTICSEARCH:$ELASTIC_VERSION
environment:
- bootstrap.memory_lock=true
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms3g -Xmx3g"
- cluster.routing.allocation.disk.threshold_enabled=false
- ELASTIC_PASSWORD=$ELASTIC_PASSWORD
- xpack.security.enabled=true
- xpack.security.authc.api_key.enabled=true
- xpack.ml.enabled=false
ulimits:
memlock:
soft: -1
hard: -1
ports: ["$ELASTICSEARCH_PORT:$ELASTICSEARCH_PORT"]
networks: ['fscrawler_it']
networks:
fscrawler_it: {}
docker-compose-enterprise-search.yml
version: '3'
services:
enterprisesearch:
image: $IMG_ENTERPRISE_SEARCH:$ELASTIC_VERSION
environment:
- "ent_search.auth.source=standard"
- "elasticsearch.username=elastic"
- "elasticsearch.password=$ELASTIC_PASSWORD"
- "elasticsearch.host=http://elasticsearch:9200"
- "allow_es_settings_modification=true"
- "secret_management.encryption_keys=[XYZ]"
- "ENT_SEARCH_DEFAULT_PASSWORD=$ELASTIC_PASSWORD"
ports: ["$ENTERPRISE_SEARCH_PORT:$ENTERPRISE_SEARCH_PORT"]
networks: ['fscrawler_it']
links: ['elasticsearch']
depends_on: ['elasticsearch']
restart: always
networks:
fscrawler_it: {}
.env
# Elastic Stack settings
ELASTIC_VERSION=7.10.0
ELASTIC_PASSWORD=changeme
# Elasticsearch settings
IMG_ELASTICSEARCH=docker.elastic.co/elasticsearch/elasticsearch
ELASTICSEARCH_PORT=9200
# Enterprise Search settings
IMG_ENTERPRISE_SEARCH=docker.elastic.co/enterprise-search/enterprise-search
ENTERPRISE_SEARCH_PORT=3002