mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2025-07-06 22:14:02 +02:00
Add uwsgi configuration
This commit is contained in:
@ -1,8 +1,25 @@
|
||||
#!/bin/bash
|
||||
# This will launch the Django project as a fastcgi socket
|
||||
# then Apache or NGINX will be able to use that socket
|
||||
|
||||
python manage.py compilemessages
|
||||
python manage.py makemigrations
|
||||
|
||||
# Wait for database
|
||||
sleep 2
|
||||
|
||||
python manage.py migrate
|
||||
|
||||
# TODO: use uwsgi in production
|
||||
python manage.py runserver 0.0.0.0:8000
|
||||
uwsgi --chdir="$(pwd)" \
|
||||
--module=med.wsgi:application \
|
||||
--env DJANGO_SETTINGS_MODULE=med.settings \
|
||||
--master \
|
||||
--pidfile="$(pwd)/uwsgi.pid" \ # create a pidfile
|
||||
--socket="$(pwd)/uwsgi.sock" \
|
||||
--processes=5 \
|
||||
--chmod-socket=600 \
|
||||
--harakiri=20 \ # respawn processes taking more than 20 seconds
|
||||
--max-requests=5000 \ # respawn processes after serving 5000 requests
|
||||
--vacuum \ # clean up when stopped
|
||||
--daemonize="$(pwd)/uwsgi.log" \
|
||||
--protocol=fastcgi
|
Reference in New Issue
Block a user