diff --git a/common.shinc b/common.shinc index 804a0ef..a776408 100644 --- a/common.shinc +++ b/common.shinc @@ -10,7 +10,7 @@ for _var in ${REQUIRED_VARIABLES[@]}; do done source ${SCRIPT_PATH}/../settings.shinc -source ${SCRIPT_PATH}/../env.shinc +source ${SCRIPT_PATH}/../env.shinc 2> /dev/null source ${SCRIPT_PATH}/../functions.shinc diff --git a/elastic-search/Dockerfile b/elastic-search/Dockerfile new file mode 100644 index 0000000..a876a13 --- /dev/null +++ b/elastic-search/Dockerfile @@ -0,0 +1,11 @@ +ARG IMAGE_NAME +ARG IMAGE_VERSION +FROM ${IMAGE_NAME}:${IMAGE_VERSION} + +ADD elasticsearch.yml /usr/share/elasticsearch/config/ + +USER root + +RUN chown elasticsearch:elasticsearch config/elasticsearch.yml + +USER elasticsearch diff --git a/elastic-search/elasticsearch.yml b/elastic-search/elasticsearch.yml new file mode 100644 index 0000000..59d01ae --- /dev/null +++ b/elastic-search/elasticsearch.yml @@ -0,0 +1,12 @@ +http: + host: 0.0.0.0 +transport: + host: 127.0.0.1 +xpack: + security: + enabled: false + authc: + anonymous: + roles: + - role1 + - role2 diff --git a/elastic-search/run.sh b/elastic-search/run.sh new file mode 100755 index 0000000..e00aee0 --- /dev/null +++ b/elastic-search/run.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +SCRIPT_PATH=$( cd "$(dirname "$0")" ; pwd -P ) + +IMAGE_NAME="docker.elastic.co/elasticsearch/elasticsearch" +IMAGE_VERSION="5.3.2" + +PROJECT_NAME=elastic-search + + +source ${SCRIPT_PATH}/../common.shinc + +# +# Project specific variables +# + +DOMAIN_NAME="elastic.loc" + + +init() { + __init + + # Create networks + NETWORKS=(${SEARCH_ENGINE_NETWORK}) + __createNetworks + + __build || return $? + + docker create \ + --name ${PROJECT_NAME} \ + -e VIRTUAL_HOST=${DOMAIN_NAME} \ + --net ${SEARCH_ENGINE_NETWORK} \ + ${PROJECT_NAME}:latest + + [[ $? -ne 0 ]] && return 1 + + __ask_to_start +} + +"$@" + +exit $? diff --git a/settings.shinc b/settings.shinc index 9d92d86..1d4c6d1 100644 --- a/settings.shinc +++ b/settings.shinc @@ -16,6 +16,8 @@ DB_NETWORK="database" # Mail SMTP_NETWORK="smtp" +# Elastic search +SEARCH_ENGINE_NETWORK="elastic"