47 lines
692 B
Bash
Executable File
47 lines
692 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
SCRIPT_PATH=$( cd "$(dirname "$0")" ; pwd -P )
|
|
|
|
IMAGE_NAME="elasticsearch"
|
|
IMAGE_VERSION="2.3.5"
|
|
|
|
SERVICE_NAME=ys-elastic-search
|
|
|
|
|
|
source ${SCRIPT_PATH}/../common.shinc
|
|
|
|
#
|
|
# Project specific variables
|
|
#
|
|
|
|
DOMAIN_NAME="elastic.loc"
|
|
|
|
source ${SCRIPT_PATH}/env.shinc 2> /dev/null
|
|
|
|
|
|
init() {
|
|
__init
|
|
|
|
# Create networks
|
|
NETWORKS=(${SEARCH_ENGINE_NETWORK} ${PROXY_NETWORK})
|
|
__createNetworks
|
|
|
|
__build || return $?
|
|
|
|
docker create \
|
|
--name ${SERVICE_NAME} \
|
|
-e VIRTUAL_HOST=${DOMAIN_NAME} \
|
|
--net ${SEARCH_ENGINE_NETWORK} \
|
|
${SERVICE_NAME}:latest
|
|
|
|
[[ $? -ne 0 ]] && return 1
|
|
|
|
docker network connect ${PROXY_NETWORK} ${SERVICE_NAME}
|
|
|
|
__ask_to_start
|
|
}
|
|
|
|
"$@"
|
|
|
|
exit $?
|