-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba6ea51
commit 89c683c
Showing
7 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from fastapi import APIRouter | ||
|
||
router = APIRouter() | ||
|
||
|
||
@router.get("/test") | ||
async def test(): | ||
return {"message": "Test endpoint is working!"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"}) |