Merge pull request #135

fix(docker:single): procrastinate starts before django
This commit is contained in:
Herculino Trotta
2025-02-05 10:52:47 -03:00
committed by GitHub
4 changed files with 27 additions and 0 deletions

View File

@@ -4,5 +4,11 @@ set -o errexit
set -o pipefail
set -o nounset
rm -f /tmp/migrations_complete
python manage.py migrate
# Create flag file to signal migrations are complete
touch /tmp/migrations_complete
exec python manage.py runserver 0.0.0.0:8000

View File

@@ -4,4 +4,12 @@ set -o errexit
set -o nounset
# Wait for migrations to complete
until [ -f /tmp/migrations_complete ]; do
echo "Procastinate is waiting for web app to start..."
sleep 2
done
rm -f /tmp/migrations_complete
exec watchfiles --filter python "python manage.py procrastinate worker"

View File

@@ -4,8 +4,13 @@ set -o errexit
set -o pipefail
set -o nounset
# Remove flag file if it exists from previous run
rm -f /tmp/migrations_complete
python manage.py collectstatic --noinput
python manage.py migrate
# Create flag file to signal migrations are complete
touch /tmp/migrations_complete
exec gunicorn WYGIWYH.wsgi:application --bind 0.0.0.0:8000 --timeout 600

View File

@@ -4,4 +4,12 @@ set -o errexit
set -o nounset
# Wait for migrations to complete
until [ -f /tmp/migrations_complete ]; do
echo "Procastinate is waiting for web app to start..."
sleep 2
done
rm -f /tmp/migrations_complete
exec python manage.py procrastinate worker