From 26d6f302cf1198e932ae5f25dce3a2d97d816e02 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Tue, 20 Jun 2023 08:05:03 -0700 Subject: [PATCH] When starting with an external DB, start it for a bit first to allow its setup to complete --- install-paperless-ngx.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install-paperless-ngx.sh b/install-paperless-ngx.sh index 469f96005..512ed9ab5 100755 --- a/install-paperless-ngx.sh +++ b/install-paperless-ngx.sh @@ -384,6 +384,14 @@ fi ${DOCKER_COMPOSE_CMD} pull +if [ "$DATABASE_BACKEND" == "postgres" ] || [ "$DATABASE_BACKEND" == "mariadb" ] ; then + echo "Starting DB first for initilzation" + ${DOCKER_COMPOSE_CMD} up --detach db + # hopefully enough time for even the slower systems + sleep 15 + ${DOCKER_COMPOSE_CMD} stop +fi + ${DOCKER_COMPOSE_CMD} run --rm -e DJANGO_SUPERUSER_PASSWORD="$PASSWORD" webserver createsuperuser --noinput --username "$USERNAME" --email "$EMAIL" ${DOCKER_COMPOSE_CMD} up --detach