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.

start.sh 862 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. # -----------------------------------------------------------------------------
  3. # docker-pinry /start script
  4. #
  5. # Will setup database and static files if they don't exist already, if they do
  6. # just continues to run docker-pinry.
  7. #
  8. # Authors: Isaac Bythewood
  9. # Updated: Aug 19th, 2014
  10. # -----------------------------------------------------------------------------
  11. # If static files don't exist collect them
  12. if [ ! -d /data/static ]
  13. then
  14. cd /srv/www/pinry
  15. python manage.py collectstatic --noinput
  16. fi
  17. # If database doesn't exist yet create it
  18. if [ ! -f /data/production.db ]
  19. then
  20. cd /srv/www/pinry
  21. python manage.py migrate --noinput --settings=pinry.settings.docker
  22. fi
  23. # Fix all settings after all commands are run
  24. chown -R www-data:www-data /data
  25. # start all process
  26. /usr/sbin/nginx
  27. cd /srv/www/pinry/
  28. /scripts/_start_gunicorn.sh