From 56836d834cf85d29272a232d85fc853cd5447fae Mon Sep 17 00:00:00 2001 From: Jonas Thiel Date: Mon, 10 Jul 2017 12:28:34 +0200 Subject: [PATCH] Only configure database connection if needed --- app/docker-entry.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/docker-entry.sh b/app/docker-entry.sh index e5d9542..4b67798 100644 --- a/app/docker-entry.sh +++ b/app/docker-entry.sh @@ -51,9 +51,14 @@ if [ "$1" = 'platform' ]; then echo "Using existing config file" $MM_CONFIG fi - echo -ne "Configure database connection..." - export MM_SQLSETTINGS_DATASOURCE="postgres://$MM_USERNAME:$MM_PASSWORD@$DB_HOST:$DB_PORT_NUMBER/$MM_DBNAME?sslmode=disable&connect_timeout=10" - echo OK + if [ -z "$MM_SQLSETTINGS_DATASOURCE"] + then + echo -ne "Configure database connection..." + export MM_SQLSETTINGS_DATASOURCE="postgres://$MM_USERNAME:$MM_PASSWORD@$DB_HOST:$DB_PORT_NUMBER/$MM_DBNAME?sslmode=disable&connect_timeout=10" + echo OK + else + echo "Using existing database connection" + fi echo "Wait until database $DB_HOST:$DB_PORT_NUMBER is ready..." until nc -z $DB_HOST $DB_PORT_NUMBER