2
0

docker-entrypoint.sh 360 B

12345678910111213141516171819
  1. #!/bin/sh
  2. set -e
  3. until psql $DATABASE_URL -c '\q'; do
  4. >&2 echo "Postgres is unavailable - sleeping"
  5. sleep 1
  6. done
  7. >&2 echo "Postgres is up - continuing"
  8. if [ "$1" = '/venv/bin/uwsgi' ]; then
  9. /venv/bin/python manage.py migrate --noinput
  10. fi
  11. if [ "x$DJANGO_LOAD_INITIAL_DATA" = 'xon' ]; then
  12. /venv/bin/python manage.py load_initial_data
  13. fi
  14. exec "$@"