Initial commit

This commit is contained in:
Arnie
2018-01-04 06:34:06 +01:00
parent 4cd30eea87
commit 524b9f1c0e
12 changed files with 542 additions and 0 deletions
Executable
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
SCRIPT_PATH=$( cd "$(dirname "$0")" ; pwd -P )
IMAGE_NAME="mailhog/mailhog"
IMAGE_VERSION="latest"
PROJECT_NAME=mailhog
source ${SCRIPT_PATH}/../common.shinc
#
# Project specific variables
#
SMTP_PORT=1025
WEB_PORT=8025
DOMAIN_NAME="mailhog.loc"
init() {
__init
NETWORKS=(${SMTP_NETWORK} ${PROXY_NETWORK})
__createNetworks
docker create \
--name ${PROJECT_NAME} \
-e VIRTUAL_HOST=${DOMAIN_NAME} \
-e VIRTUAL_PORT=${WEB_PORT} \
-p ${SMTP_PORT}:1025 \
${IMAGE_NAME}:${IMAGE_VERSION}
[[ $? -ne 0 ]] && return 1
docker network connect ${SMTP_NETWORK} ${PROJECT_NAME}
[[ $? -ne 0 ]] && return 1
docker network connect ${PROXY_NETWORK} ${PROJECT_NAME}
[[ $? -ne 0 ]] && return 1
__ask_to_start
}
"$@"
exit $?