feat(): docker for backend and ml

This commit is contained in:
gitgernit
2025-11-22 13:57:31 +03:00
parent 099fecc218
commit 00af067f4d
8 changed files with 209 additions and 153 deletions
+2 -1
View File
@@ -14,7 +14,7 @@ from fastapi.middleware.cors import CORSMiddleware
from template_project.ml.configuration import load_configuration
from template_project.ml.ioc.make import make_ioc
from template_project.ml.routes import embedding
from template_project.ml.routes import embedding, healthcheck
LOG_CONFIG: Final = {
"version": 1,
@@ -54,6 +54,7 @@ def make_asgi_application(
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(healthcheck.router)
app.include_router(embedding.router)
setup_dishka(container=ioc, app=app)
@@ -0,0 +1,23 @@
from dishka.integrations.fastapi import DishkaRoute
from fastapi import APIRouter
from pydantic import BaseModel, Field
router = APIRouter(route_class=DishkaRoute, tags=["Health"])
class HealthcheckResponse(BaseModel):
ok: bool = Field(description="Service health status")
model_config = {"json_schema_extra": {"example": {"ok": True}}}
@router.get(
"/healthcheck",
summary="Health check",
description="Check if the service is running and healthy",
responses={
200: {"description": "Service is healthy", "model": HealthcheckResponse},
},
)
async def healthcheck() -> HealthcheckResponse:
return HealthcheckResponse(ok=True)