Livrare LOT 1 - Didi
This commit is contained in:
commit
5380c3fc63
990 changed files with 133308 additions and 0 deletions
35
ai_platform/modules/didi_brain/brain_api/run.py
Normal file
35
ai_platform/modules/didi_brain/brain_api/run.py
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
"""Entry point for the brain_api FastAPI service.
|
||||
|
||||
python -m brain_api.run
|
||||
|
||||
Bind host defaults to 127.0.0.1 (local dev, loopback only). Containerized
|
||||
runs must override with BRAIN_API_HOST=0.0.0.0 so Docker port mapping can
|
||||
actually forward traffic in from the outside.
|
||||
|
||||
Environment variables:
|
||||
BRAIN_API_HOST bind address (default: 127.0.0.1)
|
||||
BRAIN_API_PORT port (default: 8090)
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
import uvicorn
|
||||
|
||||
|
||||
def main() -> None:
|
||||
host = os.environ.get("BRAIN_API_HOST", "127.0.0.1")
|
||||
port = int(os.environ.get("BRAIN_API_PORT", "8090"))
|
||||
uvicorn.run(
|
||||
"brain_api.app:app",
|
||||
host=host,
|
||||
port=port,
|
||||
reload=False,
|
||||
log_level="info",
|
||||
access_log=True,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue