diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..f4c0c99 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,15 @@ +# Use an official Python runtime with NVIDIA CUDA support +FROM nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu20.04 + +WORKDIR /app + +# Copy your application files +COPY . /app + +# Install Python and FastAPI dependencies +RUN apt-get update && apt-get install -y python3-pip && \ + pip3 install --no-cache-dir -r requirements.txt + +EXPOSE 8000 + +CMD uvicorn main:app --port=${PORT:-8000} --host=0.0.0.0 diff --git a/backend/__init__.py b/backend/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/__init__.py b/backend/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/api/v1/__init__.py b/backend/app/api/v1/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/api/v1/endponts/__init__.py b/backend/app/api/v1/endponts/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/api/v1/endponts/test_endpoint.py b/backend/app/api/v1/endponts/test_endpoint.py new file mode 100644 index 0000000..e5c19bf --- /dev/null +++ b/backend/app/api/v1/endponts/test_endpoint.py @@ -0,0 +1,8 @@ +from fastapi import APIRouter + +router = APIRouter() + + +@router.get("/test") +async def test(): + return {"message": "Test endpoint is working!"} diff --git a/backend/app/main.py b/backend/app/main.py new file mode 100644 index 0000000..498de82 --- /dev/null +++ b/backend/app/main.py @@ -0,0 +1,18 @@ +from fastapi import FastAPI, HTTPException, status, Request +from fastapi.responses import RedirectResponse, JSONResponse +from app.api.v1.endponts import test_endpoint + + +app = FastAPI(title="Title") + +app.include_router(test_endpoint.router, prefix="/api/v1") + + +@app.get("/") +async def root(request: Request): + return RedirectResponse(url="/docs", status_code=status.HTTP_307_TEMPORARY_REDIRECT) + + +@app.get("/metrics") +async def metrics(): + return JSONResponse(content={"message": "Metrics not implemented"})