From 9851eb52ee9d80ad284a8b872892c799d808c300 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Wed, 12 Jan 2022 18:17:09 +0100 Subject: [PATCH] waiting for the database container on setup --- rootfs/usr/local/bin/setup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rootfs/usr/local/bin/setup.sh b/rootfs/usr/local/bin/setup.sh index 30c58c3..fef6342 100755 --- a/rootfs/usr/local/bin/setup.sh +++ b/rootfs/usr/local/bin/setup.sh @@ -55,6 +55,12 @@ cat >> /nextcloud/config/autoconfig.php < EOF +until nc -z "${DB_HOST:-nextcloud-db}" "${DB_PORT:-3306}" +do + echo "waiting for the database container..." + sleep 1 +done + echo "Starting automatic configuration..." # Execute setup (cd /nextcloud; php index.php &>/dev/null)