Files
kennethreitz 57b4ed7dd9 Switch from gunicorn/uvicorn to granian with Rust-level static file serving
Replaces gunicorn + uvicorn with granian across all entry points (Dockerfile,
docker-compose, main.py, sidecar script). Static files are now served directly
from granian's Rust layer, bypassing Python entirely for /static routes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:07:23 -04:00

27 lines
626 B
Python

import os
from pathlib import Path
from granian import Granian
from .server import app # noqa: F401
def main():
"""Main entry point for the KJV Study application."""
workers = int(os.getenv("WORKERS", "4"))
static_dir = str(Path(__file__).parent / "static")
granian = Granian(
"kjvstudy_org.server:app",
address="0.0.0.0",
port=8000,
interface="asgi",
workers=workers,
reload=False,
static_path_route="/static",
static_path_mount=static_dir,
static_path_expires=86400,
)
granian.serve()
if __name__ == "__main__":
main()