2026-02-26 12:08:16 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
|
set -o pipefail
|
|
|
|
|
set -o nounset
|
|
|
|
|
|
|
|
|
|
DB_HOST="${POSTGRES_HOST}"
|
|
|
|
|
DB_PORT="${POSTGRES_PORT}"
|
|
|
|
|
|
|
|
|
|
echo "Waiting for database at ${DB_HOST}:${DB_PORT}..."
|
|
|
|
|
wait-for-it ${DB_HOST}:${DB_PORT} --timeout=30 --strict || {
|
|
|
|
|
echo "Timed out waiting for database" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "Database is available, continuing startup..."
|
|
|
|
|
|
|
|
|
|
python manage.py makemigrations
|
|
|
|
|
python manage.py migrate --noinput
|
|
|
|
|
|
|
|
|
|
for fixture in /app/data/*.json; do
|
|
|
|
|
echo "Loading fixture: $fixture"
|
|
|
|
|
python manage.py loaddata "$fixture"
|
|
|
|
|
done
|
|
|
|
|
|
2026-02-27 01:02:21 +00:00
|
|
|
python manage.py reset_passwords
|
|
|
|
|
|
2026-02-26 12:08:16 +00:00
|
|
|
python manage.py collectstatic --noinput
|
|
|
|
|
exec daphne -b 0.0.0.0 -p 8000 config.asgi:application
|