entrypoint.sh 591 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. #
  3. set -e
  4. # init db
  5. if [ ! -d /var/lib/mysql/mysql ]; then
  6. echo 'Initializing db, please wait ...'
  7. REQUIRE_INIT_OPS=true
  8. /bin/sh /scripts/init_db.sh
  9. fi
  10. # init nginx
  11. if [ ! -d /run/nginx ]; then
  12. mkdir -p /run/nginx
  13. chown -R nginx.nginx /run/nginx
  14. fi
  15. # init config
  16. if [ ! -f /init_config.lock ]; then
  17. /bin/sh /scripts/init_config.sh
  18. touch /init_config.lock
  19. fi
  20. cd /spug/spug_api
  21. nginx
  22. nohup /usr/bin/mysqld_safe --datadir=/var/lib/mysql --user=root &
  23. sleep 3
  24. /usr/local/bin/python /scripts/init_spug.py
  25. gunicorn --threads=32 main:app -b 0.0.0.0:3000