19 lines
336 B
Bash
19 lines
336 B
Bash
#!/bin/sh
|
|
|
|
DB_HOST=${DB_HOST:-localhost}
|
|
DB_PORT=${DB_PORT:-5432}
|
|
|
|
echo "Waiting for PostgreSQL at $DB_HOST:$DB_PORT..."
|
|
|
|
while ! nc -z "$DB_HOST" "$DB_PORT"; do
|
|
sleep 0.1
|
|
done
|
|
|
|
echo "PostgreSQL started"
|
|
|
|
python manage.py makemigrations --noinput
|
|
python manage.py migrate --noinput
|
|
python manage.py collectstatic --noinput
|
|
|
|
exec "$@"
|