Files
Pinry/docker/scripts/start.sh

34 lines
929 B
Bash
Raw Normal View History

2019-03-19 07:54:41 +08:00
#!/bin/bash
# -----------------------------------------------------------------------------
# docker-pinry /start script
#
# Will setup database and static files if they don't exist already, if they do
# just continues to run docker-pinry.
#
# Authors: Isaac Bythewood
# Updated: Aug 19th, 2014
# -----------------------------------------------------------------------------
PROJECT_ROOT="/pinry"
2019-03-19 07:54:41 +08:00
2019-12-19 19:58:06 +08:00
bash ${PROJECT_ROOT}/docker/scripts/bootstrap.sh
2019-03-19 07:54:41 +08:00
# If static files don't exist collect them
cd ${PROJECT_ROOT}
2019-12-19 20:31:36 +08:00
python manage.py collect --noinput --settings=pinry.settings.docker
2019-03-19 07:54:41 +08:00
# If database doesn't exist yet create it
if [ ! -f /data/production.db ]
then
cd ${PROJECT_ROOT}
2019-03-19 07:54:41 +08:00
python manage.py migrate --noinput --settings=pinry.settings.docker
fi
# Fix all settings after all commands are run
chown -R www-data:www-data /data
# start all process
/usr/sbin/nginx
cd ${PROJECT_ROOT}
./docker/scripts/_start_gunicorn.sh