entrypoint.sh 622 B

123456789101112131415161718192021222324
  1. #!/bin/bash -e
  2. # wait for dependencies
  3. echo "waiting for dependencies ..."
  4. ./wait-dbapi
  5. ./wait-ns
  6. # set permissions for Django metrics (docker-compose.yml setting does not work, see #333)
  7. chmod 1777 /var/local/django_metrics
  8. # start cron
  9. # Start child process that starts grand-child process.
  10. # After the child process's death, the grand-child will be adopted by init.
  11. # See https://stackoverflow.com/a/20338327
  12. ( /root/cronhook/start-cron.sh & )
  13. # migrate database
  14. python manage.py migrate || exit 1
  15. # Prepare catalog zone
  16. python manage.py align-catalog-zone
  17. echo Starting API server ...
  18. exec uwsgi --ini uwsgi.ini