Additional gunicorn exec improvements
parent
b3b04a0af0
commit
30f9ea872e
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# TODO add logic to always run from root api application directory
|
||||||
|
|
||||||
|
API_LOG_LEVEL="${API_LOG_LEVEL:-info}"
|
||||||
|
API_WORKER_CLASS="${API_WORKER_CLASS:-gthread}"
|
||||||
|
API_WORKER_COUNT="${API_WORKER_COUNT:-2}"
|
||||||
|
API_THREAD_COUNT="${API_THREAD_COUNT:-4}"
|
||||||
|
|
||||||
|
if [ -f /.dockerenv ]; then
|
||||||
|
WORKER_TEMP_DIR="/dev/shm"
|
||||||
|
else
|
||||||
|
WORKER_TEMP_DIR="/tmp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec python3 -m gunicorn.app.wsgiapp --worker-tmp-dir "$WORKER_TEMP_DIR" --workers "$API_WORKER_COUNT" --access-logfile "-" \
|
||||||
|
--log-level "$API_LOG_LEVEL" --error-logfile "-" --threads "$API_THREAD_COUNT" \
|
||||||
|
--worker-class "$API_WORKER_CLASS" --bind 0.0.0.0:5000 wsgi:app
|
Loading…
Reference in New Issue