21 lines
427 B
Bash
Executable File
21 lines
427 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ "$DATABASE" = "postgres" ]
|
|
then
|
|
echo "Waiting for postgres..."
|
|
|
|
while ! nc -z $POSTGRESQL_HOST $POSTGRESQL_PORT; do
|
|
sleep 0.1
|
|
done
|
|
|
|
echo "PostgreSQL started"
|
|
fi
|
|
find . -path "*/main/migrations/*.py" -not -name "__init__.py" -delete
|
|
find . -path "*/main/migrations/*.pyc" -delete
|
|
python manage.py makemigrations
|
|
python manage.py migrate
|
|
python manage.py runserver 0.0.0.0:8000
|
|
|
|
exec "$@"
|
|
|