T13: produksi web dengan gunicorn + WAL (gunicorn.conf.py, DASH_WORKERS, V12)
This commit is contained in:
1 parent
0374f9f4c2
commit
2b95be3091
8 files changed
+42
-7
No files matched your search
@@ -0,0 +1,20 @@
|
||||
"""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 = '-'
|
||||
Reference in new issue
Block a user