From 951d534489c300bb30b75c10ded4a6899fcc6da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Fri, 15 Mar 2024 14:15:51 +0100 Subject: [PATCH] Create cache table on start --- docker-entrypoint.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 39992ac..56bd7cc 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -6,18 +6,16 @@ set -e # Debug set -x -# Wait for database -echo "Waiting for database" -while ! nc -z "$POSTGRES_HOST" "$POSTGRES_PORT"; do - sleep 0.1 -done -echo "Database started" - # 2. Apply database migrations echo "Apply database migrations" python manage.py migrate echo "Apply database migrations done" +# 3. Create cache table +echo "Create cache table" +python manage.py createcachetable +echo "Create cache table done" + # https://docs.gunicorn.org/en/stable/design.html#how-many-workers num_cores=$(nproc --all) workers=$((2 * num_cores + 1))