From b8876399f8d77126c300783f08999e0618e7ab76 Mon Sep 17 00:00:00 2001 From: John Karabudak Date: Tue, 11 Aug 2020 15:43:41 -0230 Subject: [PATCH] Added optional environment variable JOOMLA_DB_PASSWORD_FILE (#100) This environment variable is crucial for Docker secrets, as Docker secrets can only be files mounted to a specific path. Without support for reading the password out of a file, we are forced to define the database password in the docker-compose file which is not very secure. --- docker-entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index acd4f0b..0c70f98 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -2,6 +2,10 @@ set -e +if [[ -f "$JOOMLA_DB_PASSWORD_FILE" ]]; then + JOOMLA_DB_PASSWORD=$(cat "$JOOMLA_DB_PASSWORD_FILE") +fi + if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then if [ -n "$MYSQL_PORT_3306_TCP" ]; then if [ -z "$JOOMLA_DB_HOST" ]; then