mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
57b4ed7dd9
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>
27 lines
626 B
Python
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() |