Bug: added gunicorn config file

This commit is contained in:
Javier
2026-02-08 01:53:03 -06:00
parent 3b9680455c
commit b41e64be64
3 changed files with 13 additions and 2 deletions

View File

@@ -12,4 +12,4 @@ COPY . .
EXPOSE 5000 EXPOSE 5000
# Run with Gunicorn # Run with Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "4", "--timeout", "120", "--access-logfile", "-", "--error-logfile", "-", "app:app"] CMD ["gunicorn", "--config", "gunicorn_config.py", "--bind", "0.0.0.0:5000", "--workers", "4", "app:app"]

2
app.py
View File

@@ -28,7 +28,7 @@ app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(hours=1)
# 1. Define the version # 1. Define the version
APP_VERSION = '0.17.1' # Bumped version for modular architecture APP_VERSION = '0.17.2' # Bumped version for modular architecture
# 2. Inject it into all templates automatically # 2. Inject it into all templates automatically
@app.context_processor @app.context_processor

11
gunicorn_config.py Normal file
View File

@@ -0,0 +1,11 @@
def on_starting(server):
"""Called just before the master process is initialized"""
print("Gunicorn starting...")
def post_fork(server, worker):
"""Called just after a worker has been forked"""
from module_manager import get_module_manager
from app import app
module_manager = get_module_manager()
module_manager.load_active_modules(app)