1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-02-06 10:13:01 +00:00
med/entrypoint.sh

26 lines
780 B
Bash
Raw Normal View History

2020-02-02 18:22:28 +01:00
#!/bin/bash
2020-02-09 14:18:39 +01:00
# This will launch the Django project as a fastcgi socket
# then Apache or NGINX will be able to use that socket
2020-02-02 18:22:28 +01:00
python manage.py compilemessages
python manage.py makemigrations
2020-02-09 14:18:39 +01:00
# Wait for database
2020-02-02 23:13:39 +01:00
sleep 2
2020-02-09 14:18:39 +01:00
2020-02-02 18:22:28 +01:00
python manage.py migrate
2020-02-09 15:08:27 +01:00
python manage.py collectstatic
2020-02-02 18:22:28 +01:00
2020-02-09 14:18:39 +01:00
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