forked from CGM_Public/pretix_original
Updated standalone docker file and install guide
This commit is contained in:
44
deployment/docker/pretix.bash
Normal file
44
deployment/docker/pretix.bash
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
cd /pretix/src
|
||||
export DJANGO_SETTINGS_MODULE=production_settings
|
||||
export DATA_DIR=/data/
|
||||
NUM_WORKERS=10
|
||||
|
||||
if [ ! -d /data/logs ]; then
|
||||
mkdir /data/logs;
|
||||
fi
|
||||
if [ ! -d /data/media ]; then
|
||||
mkdir /data/media;
|
||||
fi
|
||||
|
||||
if [ "$1" == "cron" ]; then
|
||||
exec python3 -m pretix runperiodic
|
||||
fi
|
||||
|
||||
python3 -m pretix migrate --noinput
|
||||
|
||||
if [ "$1" == "all" ]; then
|
||||
exec sudo /usr/bin/supervisord -n -c /etc/supervisord.conf
|
||||
fi
|
||||
|
||||
if [ "$1" == "webworker" ]; then
|
||||
exec gunicorn pretix.wsgi \
|
||||
--name pretix \
|
||||
--workers $NUM_WORKERS \
|
||||
--max-requests 1200 \
|
||||
--max-requests-jitter 50 \
|
||||
--log-level=info \
|
||||
--bind=unix:/tmp/pretix.sock
|
||||
fi
|
||||
|
||||
if [ "$1" == "taskworker" ]; then
|
||||
export C_FORCE_ROOT=True
|
||||
exec celery -A pretix worker -l info
|
||||
fi
|
||||
|
||||
if [ "$1" == "shell" ]; then
|
||||
exec python3 -m pretix shell
|
||||
fi
|
||||
|
||||
echo "Specify argument: all|cron|webworker|taskworker|shell"
|
||||
exit 1
|
||||
Reference in New Issue
Block a user