diff --git a/_config/_localconfig.dist.sh b/_config/_localconfig.dist.sh index b9b04e7..7ec94bd 100644 --- a/_config/_localconfig.dist.sh +++ b/_config/_localconfig.dist.sh @@ -99,3 +99,8 @@ webportbase='6' # VNC port base: # The first digit of the port which the selenium VNC container should bind its port to vncportbase='5' + +# DB port base: +# The first digit of the port which the DB container should bind its port to +dbportbase='4' + diff --git a/bin/moodle-docker-bash.sh b/bin/moodle-docker-bash.sh index 43981dd..9e88a34 100755 --- a/bin/moodle-docker-bash.sh +++ b/bin/moodle-docker-bash.sh @@ -30,7 +30,7 @@ fi # Verify that all necessary env variables are set -if [[ -z "$COMPOSE_PROJECT_NAME" ]] || [[ -z "$MOODLE_DOCKER_WWWROOT" ]] || [[ -z "$MOODLE_DOCKER_DB" ]] || [[ -z "$MOODLE_DOCKER_PHP_VERSION" ]] || [[ -z "$MOODLE_DOCKER_WEB_PORT" ]] || [[ -z "$MOODLE_DOCKER_BROWSER" ]] || [[ -z "$MOODLE_DOCKER_SELENIUM_VNC_PORT" ]]; then +if [[ -z "$COMPOSE_PROJECT_NAME" ]] || [[ -z "$MOODLE_DOCKER_WWWROOT" ]] || [[ -z "$MOODLE_DOCKER_DB" ]] || [[ -z "$MOODLE_DOCKER_PHP_VERSION" ]] || [[ -z "$MOODLE_DOCKER_WEB_PORT" ]] || [[ -z "$MOODLE_DOCKER_BROWSER" ]] || [[ -z "$MOODLE_DOCKER_SELENIUM_VNC_PORT" ]] || [[ -z "$MOODLE_DOCKER_DB_PORT" ]]; then echo 'Necessary env variables are not set yet.' echo 'Please run moodle-docker-env.sh first' exit 1 diff --git a/bin/moodle-docker-env.sh b/bin/moodle-docker-env.sh index 789cd39..57eb5ba 100755 --- a/bin/moodle-docker-env.sh +++ b/bin/moodle-docker-env.sh @@ -179,6 +179,7 @@ port4=$(array_get_index_of $database "${databases[@]}") port5=$(array_get_index_of $php "${phps[@]}") webport=${webportbase}${port2}${port3}${port4}${port5} vncport=${vncportbase}${port2}${port3}${port4}${port5} +dbport=${dbportbase}${port2}${port3}${port4}${port5} ################################### @@ -192,6 +193,7 @@ export MOODLE_DOCKER_PHP_VERSION=$php export MOODLE_DOCKER_WEB_PORT=$bindto:$webport export MOODLE_DOCKER_BROWSER=$browser export MOODLE_DOCKER_SELENIUM_VNC_PORT=$bindto:$vncport +export MOODLE_DOCKER_DB_PORT=$bindto:$dbport ################################### @@ -216,3 +218,4 @@ echo -e "Selenium browser: \033[1m${browser}\033[0m" echo echo -e "Webserver URL: \033[1m\033[93mhttp://${bindto}:${webport}/\033[39m\033[0m" echo -e "VNC Port: \033[1m${bindto}:${vncport}\033[0m" +echo -e "DB Port: \033[1m${bindto}:${dbport}\033[0m" \ No newline at end of file diff --git a/bin/moodle-docker-init.sh b/bin/moodle-docker-init.sh index 837786a..6491c80 100755 --- a/bin/moodle-docker-init.sh +++ b/bin/moodle-docker-init.sh @@ -40,7 +40,7 @@ fi # Verify that all necessary env variables are set -if [[ -z "$COMPOSE_PROJECT_NAME" ]] || [[ -z "$MOODLE_DOCKER_WWWROOT" ]] || [[ -z "$MOODLE_DOCKER_DB" ]] || [[ -z "$MOODLE_DOCKER_PHP_VERSION" ]] || [[ -z "$MOODLE_DOCKER_WEB_PORT" ]] || [[ -z "$MOODLE_DOCKER_BROWSER" ]] || [[ -z "$MOODLE_DOCKER_SELENIUM_VNC_PORT" ]]; then +if [[ -z "$COMPOSE_PROJECT_NAME" ]] || [[ -z "$MOODLE_DOCKER_WWWROOT" ]] || [[ -z "$MOODLE_DOCKER_DB" ]] || [[ -z "$MOODLE_DOCKER_PHP_VERSION" ]] || [[ -z "$MOODLE_DOCKER_WEB_PORT" ]] || [[ -z "$MOODLE_DOCKER_BROWSER" ]] || [[ -z "$MOODLE_DOCKER_SELENIUM_VNC_PORT" ]] || [[ -z "$MOODLE_DOCKER_DB_PORT" ]]; then echo 'Necessary env variables are not set yet.' echo 'Please run moodle-docker-env.sh first' exit 1 diff --git a/bin/moodle-docker-xdebug.sh b/bin/moodle-docker-xdebug.sh index d958532..57a206b 100755 --- a/bin/moodle-docker-xdebug.sh +++ b/bin/moodle-docker-xdebug.sh @@ -38,7 +38,7 @@ fi # Verify that all necessary env variables are set -if [[ -z "$COMPOSE_PROJECT_NAME" ]] || [[ -z "$MOODLE_DOCKER_WWWROOT" ]] || [[ -z "$MOODLE_DOCKER_DB" ]] || [[ -z "$MOODLE_DOCKER_PHP_VERSION" ]] || [[ -z "$MOODLE_DOCKER_WEB_PORT" ]] || [[ -z "$MOODLE_DOCKER_BROWSER" ]] || [[ -z "$MOODLE_DOCKER_SELENIUM_VNC_PORT" ]]; then +if [[ -z "$COMPOSE_PROJECT_NAME" ]] || [[ -z "$MOODLE_DOCKER_WWWROOT" ]] || [[ -z "$MOODLE_DOCKER_DB" ]] || [[ -z "$MOODLE_DOCKER_PHP_VERSION" ]] || [[ -z "$MOODLE_DOCKER_WEB_PORT" ]] || [[ -z "$MOODLE_DOCKER_BROWSER" ]] || [[ -z "$MOODLE_DOCKER_SELENIUM_VNC_PORT" ]] || [[ -z "$MOODLE_DOCKER_DB_PORT" ]]; then echo 'Necessary env variables are not set yet.' echo 'Please run moodle-docker-env.sh first' exit 1