You've already forked RekomenciBackend
feat(): docker for backend and ml
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user