更改
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
APP_HOST="${HOST:-0.0.0.0}"
|
||||
APP_PORT="${APP_PORT:-8000}"
|
||||
APP_ENV_VALUE="${APP_ENV:-s2}"
|
||||
LOG_DIRECTORY="${LOG_DIR:-/data/webapps/lessie_sourcing_agents/logs}"
|
||||
TIMESTAMP="$(date +"%Y%m%d_%H%M%S")"
|
||||
LOGFILE="${LOG_DIRECTORY}/lessie_sourcing_agents_${TIMESTAMP}.log"
|
||||
LATEST_LINK="${LOG_DIRECTORY}/lessie_sourcing_agents_latest.log"
|
||||
GUNICORN_WORKERS="${GUNICORN_WORKERS:-8}"
|
||||
GUNICORN_TIMEOUT="${GUNICORN_TIMEOUT:-300}"
|
||||
GUNICORN_WORKER_CLASS="${GUNICORN_WORKER_CLASS:-uvicorn.workers.UvicornWorker}"
|
||||
GUNICORN_MODULE="${GUNICORN_MODULE:-dialogue.app:app}"
|
||||
|
||||
mkdir -p "${LOG_DIRECTORY}"
|
||||
touch "${LOGFILE}"
|
||||
ln -sf "${LOGFILE}" "${LATEST_LINK}"
|
||||
|
||||
echo "Starting gunicorn (${GUNICORN_MODULE}) with APP_ENV=${APP_ENV_VALUE}, logs -> ${LOGFILE}"
|
||||
|
||||
exec env APP_ENV="${APP_ENV_VALUE}" \
|
||||
gunicorn \
|
||||
-w "${GUNICORN_WORKERS}" \
|
||||
-k "${GUNICORN_WORKER_CLASS}" \
|
||||
-b "${APP_HOST}:${APP_PORT}" \
|
||||
--timeout "${GUNICORN_TIMEOUT}" \
|
||||
"${GUNICORN_MODULE}" \
|
||||
> >(tee -a "${LOGFILE}") \
|
||||
2> >(tee -a "${LOGFILE}" >&2)
|
||||
Reference in New Issue
Block a user