forked from ONSdigital/eq-questionnaire-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_app.sh
executable file
·17 lines (14 loc) · 893 Bytes
/
run_app.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
set -e
if [ "$WEB_SERVER_TYPE" = "gunicorn-async" ]; then
run_command="gunicorn application:application --worker-class gevent --timeout 0"
elif [ "$WEB_SERVER_TYPE" = "gunicorn-threads" ]; then
run_command="gunicorn application:application --worker-class gthread --timeout 0"
elif [ "$WEB_SERVER_TYPE" = "uwsgi" ]; then
run_command="uwsgi uwsgi.ini --workers ${WEB_SERVER_WORKERS} --http-keepalive=${HTTP_KEEP_ALIVE}"
elif [ "$WEB_SERVER_TYPE" = "uwsgi-threads" ]; then
run_command="uwsgi uwsgi.ini --workers ${WEB_SERVER_WORKERS} --enable-threads --threads ${WEB_SERVER_THREADS} --http-keepalive=${HTTP_KEEP_ALIVE}"
elif [ "$WEB_SERVER_TYPE" = "uwsgi-async" ]; then
run_command="uwsgi uwsgi.ini --module patched:application --workers ${WEB_SERVER_WORKERS} --gevent ${WEB_SERVER_UWSGI_ASYNC_CORES} --http-keepalive=${HTTP_KEEP_ALIVE}"
fi
eval "$run_command"