entrypoint.sh 493 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. # Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug
  3. # Copyright: (c) <spug.dev@gmail.com>
  4. # Released under the AGPL-3.0 License.
  5. set -e
  6. # init nginx
  7. if [ ! -d /run/nginx ]; then
  8. mkdir -p /run/nginx
  9. chown -R nginx.nginx /run/nginx
  10. fi
  11. # init spug
  12. if [ ! -f /spug/spug_api/db.sqlite3 ]; then
  13. cd /spug/spug_api
  14. python manage.py initdb
  15. python manage.py useradd -u admin -p spug.dev -s -n 管理员
  16. fi
  17. nginx
  18. supervisord -c /etc/supervisord.conf