added gunicorn and updated to the last version of server monitorizare

This commit is contained in:
ske087
2026-06-07 21:28:09 +03:00
parent 0aefadbfd8
commit b97372f74d
35 changed files with 2098 additions and 255 deletions
+17
View File
@@ -0,0 +1,17 @@
"""
WSGI entry point for running Server Monitor via Gunicorn.
Gunicorn imports `app` from this module. Because Gunicorn bypasses the
startup logic in main.py, this module also ensures the database tables
exist (idempotent) so a fresh deployment works on first boot.
"""
import os
from app import create_app
from config.database_config import get_db
app = create_app(os.environ.get('FLASK_ENV', 'production'))
# Ensure database tables exist (idempotent: only creates missing tables).
with app.app_context():
get_db().create_tables()