25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
935 B

  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. PROJECT_ROOT="/pinry"
  12. bash ${PROJECT_ROOT}/docker/scripts/bootstrap.sh
  13. # If static files don't exist collect them
  14. cd ${PROJECT_ROOT}
  15. python manage.py collectstatic --noinput --settings=pinry.settings.docker
  16. # If database doesn't exist yet create it
  17. if [ ! -f /data/production.db ]
  18. then
  19. cd ${PROJECT_ROOT}
  20. python manage.py migrate --noinput --settings=pinry.settings.docker
  21. fi
  22. # Fix all settings after all commands are run
  23. chown -R www-data:www-data /data
  24. # start all process
  25. /usr/sbin/nginx
  26. cd ${PROJECT_ROOT}
  27. ./docker/scripts/_start_gunicorn.sh