@@ -36,7 +36,7 @@ if [[ -x "$VIRTUAL_ENV/bin/gunicorn" ]]; then
3636 export VIRTUAL_ENV
3737 export PATH=" $VIRTUAL_ENV /bin:$PATH "
3838 python_cmd=" $VIRTUAL_ENV /bin/python"
39- gunicorn_cmd=" $VIRTUAL_ENV /bin/gunicorn"
39+ gunicorn_cmd=( " $VIRTUAL_ENV /bin/gunicorn" )
4040else
4141 # Fallback to system python if venv missing
4242 python_cmd=python3
4747 elif command -v python3.13 & > /dev/null; then
4848 python_cmd=python3.13
4949 fi
50- gunicorn_cmd=" $python_cmd -m gunicorn"
50+ gunicorn_cmd=( " $python_cmd " " -m " " gunicorn" )
5151fi
5252
53- $ gunicorn_cmd wsgi:app --worker-class " $OCR_SERVICE_WORKER_CLASS " \
54- --bind " $OCR_SERVICE_HOST :$OCR_SERVICE_PORT " \
55- --threads " 1" \
56- --workers " $OCR_WEB_SERVICE_WORKERS " \
57- --access-logfile " $OCR_SERVICE_GUNICORN_LOG_FILE_PATH " \
58- --log-level " $OCR_SERVICE_GUNICORN_LOG_LEVEL " \
59- --max-requests " $OCR_SERVICE_GUNICORN_MAX_REQUESTS " \
60- --max-requests-jitter " $OCR_SERVICE_GUNICORN_MAX_REQUESTS_JITTER " \
61- --timeout " $OCR_SERVICE_GUNICORN_TIMEOUT " \
62- --graceful-timeout " $OCR_SERVICE_GUNICORN_GRACEFUL_TIMEOUT "
53+ exec " ${ gunicorn_cmd[@]} " wsgi:app --worker-class " $OCR_SERVICE_WORKER_CLASS " \
54+ --bind " $OCR_SERVICE_HOST :$OCR_SERVICE_PORT " \
55+ --threads " 1" \
56+ --workers " $OCR_WEB_SERVICE_WORKERS " \
57+ --access-logfile " $OCR_SERVICE_GUNICORN_LOG_FILE_PATH " \
58+ --log-level " $OCR_SERVICE_GUNICORN_LOG_LEVEL " \
59+ --max-requests " $OCR_SERVICE_GUNICORN_MAX_REQUESTS " \
60+ --max-requests-jitter " $OCR_SERVICE_GUNICORN_MAX_REQUESTS_JITTER " \
61+ --timeout " $OCR_SERVICE_GUNICORN_TIMEOUT " \
62+ --graceful-timeout " $OCR_SERVICE_GUNICORN_GRACEFUL_TIMEOUT "
0 commit comments