File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ ENV LOG_CONFIG="logging-dev.json"
1010
1111USER root
1212
13+ # curl is required for CDP health checks
1314# Install curl via Debian 13 (trixie) backport to patch CVE-2025-0725
1415RUN echo "deb https://deb.debian.org/debian bookworm-backports main" > /etc/apt/sources.list.d/bookworm-backports.list \
1516 && apt update \
Original file line number Diff line number Diff line change 44
55class AppConfig (BaseSettings ):
66 model_config = SettingsConfigDict ()
7+ python_env : str | None = None
78 host : str | None = None
89 port : int | None = None
910 log_config : str | None = None
Original file line number Diff line number Diff line change 11from contextlib import asynccontextmanager
22from logging import getLogger
33
4+ import uvicorn
45from fastapi import FastAPI
56
67from app .common .mongo import get_mongo_client
78from app .common .tracing import TraceIdMiddleware
9+ from app .config import config
810from app .example .router import router as example_router
911from app .health .router import router as health_router
1012
@@ -31,3 +33,17 @@ async def lifespan(_: FastAPI):
3133# Setup Routes
3234app .include_router (health_router )
3335app .include_router (example_router )
36+
37+
38+ def main () -> None :
39+ uvicorn .run (
40+ "app.main:app" ,
41+ host = config .host ,
42+ port = config .port ,
43+ log_config = config .log_config ,
44+ reload = config .python_env == "development"
45+ )
46+
47+
48+ if __name__ == "__main__" :
49+ main ()
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ services:
5555 PORT : ${PORT:-8085}
5656 AWS_ENDPOINT_URL : ${AWS_ENDPOINT_URL:-http://localstack:4566}
5757 MONGO_URI : ${MONGO_URI:-mongodb://mongodb:27017/}
58+ HOST : ${HOST:-0.0.0.0}
5859 develop :
5960 watch :
6061 - action : sync
You can’t perform that action at this time.
0 commit comments