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.

15 lines
564 B

  1. #!/usr/bin/env bash
  2. set -o errexit
  3. if [[ ! -d "app/staticfiles" ]]; then python app/manage.py collectstatic --noinput; fi
  4. python app/manage.py wait_for_db
  5. python app/manage.py migrate
  6. python app/manage.py create_roles
  7. if [[ -n "${ADMIN_USERNAME}" ]] && [[ -n "${ADMIN_EMAIL}" ]] && [[ -n "${ADMIN_PASSWORD}" ]]; then
  8. python app/manage.py create_admin --noinput --username="${ADMIN_USERNAME}" --email="${ADMIN_EMAIL}" --password="${ADMIN_PASSWORD}"
  9. fi
  10. gunicorn --bind="0.0.0.0:${PORT:-8000}" --workers="${WORKERS:-1}" --pythonpath=app app.wsgi --timeout 300