2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 18:15:40 +00:00

Improvements for docker / gunicorn (#4031)

* Additional options for gunicorn configuration file (in docker):

Ref: https://pythonspeed.com/articles/gunicorn-in-docker/

* Catch potential error on startup

* Tweak log message for docker

* Wrap news feed update in try block
This commit is contained in:
Oliver
2022-12-08 23:06:02 +11:00
committed by GitHub
parent cd29ddaf12
commit 6b659ba22f
5 changed files with 36 additions and 17 deletions

View File

@ -4,7 +4,17 @@ import logging
import multiprocessing
import os
# Logger configuration
logger = logging.getLogger('inventree')
accesslog = '-'
errorlog = '-'
loglevel = os.environ.get('INVENTREE_LOG_LEVEL', 'warning').lower()
capture_output = True
# Worker configuration
worker_class = 'gevent' # Allow multi-threading support
worker_tmp_dir = '/dev/shm' # Write temp file to RAM (faster)
threads = 4
workers = os.environ.get('INVENTREE_GUNICORN_WORKERS', None)

View File

@ -20,7 +20,7 @@ fi
# Check if "config.yaml" has been copied into the correct location
if test -f "$INVENTREE_CONFIG_FILE"; then
echo "$INVENTREE_CONFIG_FILE exists - skipping"
echo "Loading config file : $INVENTREE_CONFIG_FILE"
else
echo "Copying config file to $INVENTREE_CONFIG_FILE"
cp $INVENTREE_HOME/InvenTree/config_template.yaml $INVENTREE_CONFIG_FILE

View File

@ -14,3 +14,4 @@ mariadb>=1.0.7,<1.1.0
# gunicorn web server
gunicorn>=20.1.0
gevent>=22.10.2