diff --git a/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh index 0ce2a72e13..2ac628a456 100755 --- a/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh @@ -57,7 +57,11 @@ file_env() { # Check prerequisites for MySQL database check_variables() { - : ${DB_SERVER_HOST:="mysql-server"} + if [ ! -n "${DB_SERVER_SOCKET}" ]; then + : ${DB_SERVER_HOST:="mysql-server"} + else + DB_SERVER_HOST="localhost" + fi : ${DB_SERVER_PORT:="3306"} file_env MYSQL_USER diff --git a/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh index 976f208fa1..f2f09667c4 100755 --- a/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh @@ -57,7 +57,11 @@ file_env() { # Check prerequisites for MySQL database check_variables() { - : ${DB_SERVER_HOST:="mysql-server"} + if [ ! -n "${DB_SERVER_SOCKET}" ]; then + : ${DB_SERVER_HOST:="mysql-server"} + else + DB_SERVER_HOST="localhost" + fi : ${DB_SERVER_PORT:="3306"} file_env MYSQL_USER diff --git a/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh index 976f208fa1..f2f09667c4 100755 --- a/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh @@ -57,7 +57,11 @@ file_env() { # Check prerequisites for MySQL database check_variables() { - : ${DB_SERVER_HOST:="mysql-server"} + if [ ! -n "${DB_SERVER_SOCKET}" ]; then + : ${DB_SERVER_HOST:="mysql-server"} + else + DB_SERVER_HOST="localhost" + fi : ${DB_SERVER_PORT:="3306"} file_env MYSQL_USER diff --git a/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh index 434b15491a..66eeeaed89 100755 --- a/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh @@ -57,7 +57,11 @@ file_env() { # Check prerequisites for MySQL database check_variables() { - : ${DB_SERVER_HOST:="mysql-server"} + if [ ! -n "${DB_SERVER_SOCKET}" ]; then + : ${DB_SERVER_HOST:="mysql-server"} + else + DB_SERVER_HOST="localhost" + fi : ${DB_SERVER_PORT:="3306"} file_env MYSQL_USER diff --git a/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh index c9c80250a0..f69b3fe8bd 100755 --- a/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh @@ -57,7 +57,11 @@ file_env() { # Check prerequisites for MySQL database check_variables() { - : ${DB_SERVER_HOST:="mysql-server"} + if [ ! -n "${DB_SERVER_SOCKET}" ]; then + : ${DB_SERVER_HOST:="mysql-server"} + else + DB_SERVER_HOST="localhost" + fi : ${DB_SERVER_PORT:="3306"} file_env MYSQL_USER diff --git a/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh index 12902b4154..48158a5706 100755 --- a/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh @@ -57,7 +57,11 @@ file_env() { # Check prerequisites for MySQL database check_variables() { - : ${DB_SERVER_HOST:="mysql-server"} + if [ ! -n "${DB_SERVER_SOCKET}" ]; then + : ${DB_SERVER_HOST:="mysql-server"} + else + DB_SERVER_HOST="localhost" + fi : ${DB_SERVER_PORT:="3306"} file_env MYSQL_USER diff --git a/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh index 12902b4154..48158a5706 100755 --- a/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh @@ -57,7 +57,11 @@ file_env() { # Check prerequisites for MySQL database check_variables() { - : ${DB_SERVER_HOST:="mysql-server"} + if [ ! -n "${DB_SERVER_SOCKET}" ]; then + : ${DB_SERVER_HOST:="mysql-server"} + else + DB_SERVER_HOST="localhost" + fi : ${DB_SERVER_PORT:="3306"} file_env MYSQL_USER diff --git a/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh index ce94d0ed26..5533553132 100755 --- a/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh @@ -57,7 +57,11 @@ file_env() { # Check prerequisites for MySQL database check_variables() { - : ${DB_SERVER_HOST:="mysql-server"} + if [ ! -n "${DB_SERVER_SOCKET}" ]; then + : ${DB_SERVER_HOST:="mysql-server"} + else + DB_SERVER_HOST="localhost" + fi : ${DB_SERVER_PORT:="3306"} file_env MYSQL_USER diff --git a/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh index 6a3bb25820..a4f11168b4 100755 --- a/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh @@ -57,7 +57,11 @@ file_env() { # Check prerequisites for MySQL database check_variables() { - : ${DB_SERVER_HOST:="mysql-server"} + if [ ! -n "${DB_SERVER_SOCKET}" ]; then + : ${DB_SERVER_HOST:="mysql-server"} + else + DB_SERVER_HOST="localhost" + fi : ${DB_SERVER_PORT:="3306"} file_env MYSQL_USER