diff --git a/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh index b882666fc3..baba67347a 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 fc0011add9..83e8bcb8c9 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 fc0011add9..83e8bcb8c9 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 f654739913..7643c27ecf 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 44a9203142..67df2cb597 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 5664473e7e..f71ce38951 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 5664473e7e..f71ce38951 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 b00c05bdc9..7463182cba 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 08b65d2f04..443c1bf261 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