Add gunicorn to docker setup

This commit is contained in:
Piero Toffanin
2025-12-04 00:22:41 -05:00
parent f7339b5dd3
commit cf01bbf76a
12 changed files with 64 additions and 981 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
set -eo pipefail
__dirname=$(cd "$(dirname "$0")"; pwd -P)
cd "${__dirname}/.."
echo ""
echo "░█░░░▀█▀░█▀▄░█▀▄░█▀▀░▀█▀░█▀▄░█▀█░█▀█░█▀▀░█░░░█▀█░▀█▀░█▀▀"
echo "░█░░░░█░░█▀▄░█▀▄░█▀▀░░█░░█▀▄░█▀█░█░█░▀▀█░█░░░█▀█░░█░░█▀▀"
echo "░▀▀▀░▀▀▀░▀▀░░▀░▀░▀▀▀░░▀░░▀░▀░▀░▀░▀░▀░▀▀▀░▀▀▀░▀░▀░░▀░░▀▀▀"
echo "v$(cat VERSION)"
echo ""
echo Booting...
if [ -f ./venv/bin/libretranslate ]; then
LT_POWERCYCLE=1 ./venv/bin/libretranslate "$@"
else
echo "WARNING: Cannot powercycle LibreTranslate (if you are in development mode, that's fine..)"
fi
eval $(./venv/bin/python ./scripts/print_args_env.py "$@")
PROMETHEUS_MULTIPROC_DIR="${__dirname}/../db/prometheus" ./venv/bin/gunicorn -c scripts/gunicorn_conf.py --workers $LT_THREADS --max-requests 250 --timeout 90 --bind [::]:$LT_PORT 'wsgi:app'