mirror of
https://github.com/pinry/pinry.git
synced 2025-11-18 02:40:40 +01:00
Move the docker related content to a better folder
This commit is contained in:
3
docker/scripts/_start_gunicorn.sh
Normal file
3
docker/scripts/_start_gunicorn.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
gunicorn pinry.wsgi -b 0.0.0.0:8000 -w 4 \
|
||||
--capture-output --timeout 30 --user www-data --group www-data
|
||||
13
docker/scripts/gen_key.sh
Normal file
13
docker/scripts/gen_key.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check for secret key if one doesn't exist create.
|
||||
if [ ! -f /data/production_secret_key.txt ]
|
||||
then
|
||||
cd /data
|
||||
PRODUCTION_SECRET_KEY=`pwgen -c -n -1 65`
|
||||
echo $PRODUCTION_SECRET_KEY > /data/production_secret_key.txt
|
||||
else
|
||||
PRODUCTION_SECRET_KEY=`cat /data/production_secret_key.txt`
|
||||
fi
|
||||
|
||||
echo ${PRODUCTION_SECRET_KEY}
|
||||
34
docker/scripts/start.sh
Normal file
34
docker/scripts/start.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/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
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
# If static files don't exist collect them
|
||||
if [ ! -d /data/static ]
|
||||
then
|
||||
cd /srv/www/pinry
|
||||
python manage.py collectstatic --noinput
|
||||
fi
|
||||
|
||||
# If database doesn't exist yet create it
|
||||
if [ ! -f /data/production.db ]
|
||||
then
|
||||
cd /srv/www/pinry
|
||||
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 /srv/www/pinry/
|
||||
/scripts/_start_gunicorn.sh
|
||||
Reference in New Issue
Block a user