From cde250a989e9a9d72c6856663e383d0a8e73d770 Mon Sep 17 00:00:00 2001 From: Michael Kuron Date: Mon, 8 Jan 2018 19:56:44 +0100 Subject: [PATCH] Properly wait for MySQL to come up before starting SOGo --- data/Dockerfiles/sogo/bootstrap-sogo.sh | 7 ++++--- docker-compose.yml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/Dockerfiles/sogo/bootstrap-sogo.sh b/data/Dockerfiles/sogo/bootstrap-sogo.sh index 77fad531..4bd9d570 100755 --- a/data/Dockerfiles/sogo/bootstrap-sogo.sh +++ b/data/Dockerfiles/sogo/bootstrap-sogo.sh @@ -1,7 +1,10 @@ #!/bin/bash # Wait for MySQL to warm-up -while mysqladmin ping --host mysql -u${DBUSER} -p${DBPASS}${DBPASS} --silent; do +while ! mysqladmin ping --host mysql -u${DBUSER} -p${DBPASS} --silent; do + echo "Waiting for database to come up..." + sleep 2 +done # Wait until port becomes free and send sig until ! nc -z sogo-mailcow 20000; @@ -101,5 +104,3 @@ chown sogo:sogo -R /var/lib/sogo/ chmod 600 /var/lib/sogo/GNUstep/Defaults/sogod.plist exec gosu sogo /usr/sbin/sogod - -done diff --git a/docker-compose.yml b/docker-compose.yml index 7f7b548b..438ef4dc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -124,7 +124,7 @@ services: - phpfpm sogo-mailcow: - image: mailcow/sogo:1.12 + image: mailcow/sogo:1.13 build: ./data/Dockerfiles/sogo environment: - DBNAME=${DBNAME}