From 0aabef8f7b08779cb0cee7c4fc8b42b032dfccf4 Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Thu, 13 Oct 2022 16:58:10 +0200 Subject: [PATCH] let app container wait for db init --- abra.sh | 4 ++-- compose.postgres.yml | 1 - entrypoint.sh.tmpl | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/abra.sh b/abra.sh index d0af171..d8dd9df 100644 --- a/abra.sh +++ b/abra.sh @@ -1,7 +1,7 @@ export FPM_TUNE_VERSION=v4 -export NGINX_CONF_VERSION=v3 +export NGINX_CONF_VERSION=v4 export MY_CNF_VERSION=v4 -export ENTRYPOINT_VERSION=v1 +export ENTRYPOINT_VERSION=v2 NC_APP_DIR="app:/var/www/html" diff --git a/compose.postgres.yml b/compose.postgres.yml index 02fd6f2..85630f6 100644 --- a/compose.postgres.yml +++ b/compose.postgres.yml @@ -2,7 +2,6 @@ version: '3.8' services: app: - entrypoint: "sh -c 'sleep 10 && /entrypoint.sh php-fpm'" # tries to mitigate this error with postgres https://github.com/nextcloud/docker/issues/1204 environment: - POSTGRES_HOST=db - POSTGRES_DB=nextcloud diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index 40562d4..30d21e8 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -1,5 +1,8 @@ #!/bin/bash +echo "Giving the db container some time to come up"; sleep 20 +# see this issue with postgres db https://github.com/nextcloud/docker/issues/1204 + {{ if eq (env "X_FRAME_OPTIONS_ENABLED") "1" }} if ! [[ $(grep {{ env "X_FRAME_OPTIONS_ALLOW_FROM" }} lib/public/AppFramework/Http/ContentSecurityPolicy.php) ]]; then sed -i "91 a\\\t\t'{{ env "X_FRAME_OPTIONS_ALLOW_FROM" }}', " lib/public/AppFramework/Http/ContentSecurityPolicy.php