"""Gunicorn-Konfiguration für den Projekt-Hub. Aufruf (im aktivierten venv, WorkingDirectory = Projektordner): gunicorn -c gunicorn.conf.py wsgi:app Wird vom systemd-Service (deploy/projekt-hub.service) genutzt. Werte sind über Umgebungsvariablen überschreibbar, sinnvolle Defaults für einen kleinen VPS. """ import multiprocessing import os # Bind-Adresse: Standard TCP-Port 8000 (Docker/Caddy-Betrieb). # Für Unix-Socket (z.B. nginx auf demselben Host): GUNICORN_BIND=unix:projekt-hub.sock bind = os.environ.get("GUNICORN_BIND", "0.0.0.0:8000") # Worker-Anzahl: Faustregel (2 × CPU-Kerne) + 1, per env begrenzbar. workers = int(os.environ.get("GUNICORN_WORKERS", str(multiprocessing.cpu_count() * 2 + 1))) worker_class = os.environ.get("GUNICORN_WORKER_CLASS", "sync") timeout = int(os.environ.get("GUNICORN_TIMEOUT", "30")) # Socket-Dateirechte (nur relevant im Unix-Socket-Modus). umask = 0o007 # Logs auf stdout/stderr → landen via systemd im journal (journalctl -u projekt-hub). accesslog = "-" errorlog = "-" loglevel = os.environ.get("GUNICORN_LOGLEVEL", "info") proc_name = "projekt-hub"