-
Notifications
You must be signed in to change notification settings - Fork 68
/
run.sh
27 lines (24 loc) · 774 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
set -eu
HOST=${HOST:-"0.0.0.0"}
PORT=${PORT:-8000}
WORKERS=${WORKERS:-4}
UVICORN_WORKER=${UVICORN_WORKER:-"uvicorn.workers.UvicornWorker"}
LOGLEVEL=${LOGLEVEL:-"debug"}
LOGCONFIG=${LOGCONFIG:-"./src/utils/logging.conf"}
BACKLOG=${BACKLOG:-2048}
LIMIT_MAX_REQUESTS=${LIMIT_MAX_REQUESTS:-65536}
MAX_REQUESTS_JITTER=${MAX_REQUESTS_JITTER:-2048}
GRACEFUL_TIMEOUT=${GRACEFUL_TIMEOUT:-10}
APP_NAME=${APP_NAME:-"src.api.app:app"}
gunicorn ${APP_NAME} \
-b ${HOST}:${PORT} \
-w ${WORKERS} \
-k ${UVICORN_WORKER} \
--log-level ${LOGLEVEL} \
--log-config ${LOGCONFIG} \
--backlog ${BACKLOG} \
--max-requests ${LIMIT_MAX_REQUESTS} \
--max-requests-jitter ${MAX_REQUESTS_JITTER} \
--graceful-timeout ${GRACEFUL_TIMEOUT} \
--reload