When starting with an external DB, start it for a bit first to allow its setup to complete

This commit is contained in:
Trenton H 2023-06-20 08:05:03 -07:00
parent 0fb553675b
commit 26d6f302cf

View File

@ -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