You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
562 B

  1. #!/usr/bin/env bash
  2. set -o errexit
  3. echo "Making staticfiles"
  4. python manage.py collectstatic --noinput
  5. echo "Initializing database"
  6. python manage.py wait_for_db
  7. python manage.py migrate
  8. python manage.py create_roles
  9. if [[ -n "${ADMIN_USERNAME}" ]] && [[ -n "${ADMIN_PASSWORD}" ]] && [[ -n "${ADMIN_EMAIL}" ]]; then
  10. python manage.py create_admin \
  11. --username "${ADMIN_USERNAME}" \
  12. --password "${ADMIN_PASSWORD}" \
  13. --email "${ADMIN_EMAIL}" \
  14. --noinput \
  15. || true
  16. fi
  17. echo "Starting django"
  18. gunicorn --bind 0.0.0.0:8000 app.wsgi --timeout 300