You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
628 B
Bash

#!/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