mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2024-11-27 12:13:02 +00:00
22 lines
883 B
Bash
Executable File
22 lines
883 B
Bash
Executable File
#!/bin/bash
|
|
# This will launch the Django project as a fastcgi socket
|
|
# then Apache or NGINX will be able to use that socket
|
|
|
|
# Option "-i" will be only available in Django 3.0+, but it does not support Python 3.5
|
|
#python manage.py compilemessages -i ".tox" -i "venv"
|
|
python manage.py compilemessages
|
|
|
|
# Wait for database (docker)
|
|
sleep 2
|
|
|
|
python manage.py migrate
|
|
python manage.py collectstatic --no-input
|
|
|
|
# harakiri parameter respawns processes taking more than 20 seconds
|
|
# max-requests parameter respawns processes after serving 5000 requests
|
|
# vacuum parameter cleans up when stopped
|
|
uwsgi --socket "$HOME/www/uwsgi.sock" --chmod-socket=666 --master --plugins python3 \
|
|
--module med.wsgi:application --env DJANGO_SETTINGS_MODULE=med.settings \
|
|
--processes 4 --harakiri=20 --max-requests=5000 --vacuum \
|
|
--static-map /static="$(pwd)/static" --protocol=fastcgi
|