"""Bootstrap Passenger; konfigurasi tetap dibaca oleh get_settings()."""

import atexit
import os
from pathlib import Path
import sys

project_root = Path(__file__).resolve().parent.parent
if str(project_root) not in sys.path:
    sys.path.insert(0, str(project_root))
# Passenger dapat memulai proses dari direktori selain application root.
os.chdir(project_root)

from app.main import app
from deploy.passenger import PassengerRuntime

runtime = PassengerRuntime(app)
application = runtime.application
atexit.register(runtime.close)
