Files
InviteMe/run_waitress.py
T
2026-09-01 11:03:25 +03:00

22 lines
695 B
Python

import os
from waitress import serve
from app import create_app
app = create_app()
if __name__ == "__main__":
# host=0.0.0.0 — слушаем все интерфейсы
# port — из переменной окружения или 8888 по умолчанию
port = int(os.environ.get("PORT", "8888"))
serve(
app,
# This port is reachable only on the private Compose network.
host="0.0.0.0", # nosec B104
port=port,
threads=int(os.environ.get("WAITRESS_THREADS", "8")),
connection_limit=int(os.environ.get("WAITRESS_CONNECTION_LIMIT", "200")),
channel_timeout=60,
clear_untrusted_proxy_headers=True,
)