21 lines
656 B
Python
21 lines
656 B
Python
"""Konfigurasi gunicorn untuk dashboard (produksi).
|
|
|
|
Dipanggil lewat `./venv/bin/gunicorn -c gunicorn.conf.py dashboard:app`.
|
|
Import `config` di sini → `.env` ikut termuat (gunicorn sendiri ⊥ baca dotenv).
|
|
Setiap request membuka koneksi SQLite sendiri → worker sync aman & paling sederhana.
|
|
"""
|
|
|
|
from config import DASH_HOST, DASH_PORT, DASH_WORKERS
|
|
|
|
# Bind dari config (DASH_HOST / DASH_PORT), bukan hardcoded
|
|
bind = f'{DASH_HOST}:{DASH_PORT}'
|
|
|
|
# Worker prefork; default 2 (V12), bisa dioverride via env DASH_WORKERS
|
|
workers = DASH_WORKERS
|
|
|
|
worker_class = 'sync'
|
|
|
|
# Log ke stdout/stderr agar tampil di journal/systemd
|
|
accesslog = '-'
|
|
errorlog = '-'
|