fix: add __main__ entrypoint to api-gateway so it starts under python -m
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Without this block, `python -m services.api_gateway.main` just imports the module and exits with code 0, causing CrashLoopBackOff.
This commit is contained in:
parent
e92cbc1bc4
commit
121ece5702
1 changed files with 11 additions and 0 deletions
|
|
@ -117,3 +117,14 @@ def create_app(config: ApiGatewayConfig | None = None) -> FastAPI:
|
||||||
def get_app() -> FastAPI:
|
def get_app() -> FastAPI:
|
||||||
"""Lazy app factory for uvicorn: ``uvicorn services.api_gateway.main:get_app --factory``."""
|
"""Lazy app factory for uvicorn: ``uvicorn services.api_gateway.main:get_app --factory``."""
|
||||||
return create_app()
|
return create_app()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import uvicorn
|
||||||
|
|
||||||
|
uvicorn.run(
|
||||||
|
"services.api_gateway.main:get_app",
|
||||||
|
factory=True,
|
||||||
|
host="0.0.0.0",
|
||||||
|
port=8000,
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue