Spaces:
Runtime error
Runtime error
IHappyPlant
commited on
Commit
•
eef2251
1
Parent(s):
4b66b0b
Added Dockerfile and FastAPI app
Browse files- Dockerfile +13 -0
- app.py +8 -0
- requirements.txt +2 -0
Dockerfile
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
+
# you will also find guides on how best to write your Dockerfile
|
3 |
+
|
4 |
+
FROM python:3.12
|
5 |
+
|
6 |
+
COPY . /app
|
7 |
+
WORKDIR /app
|
8 |
+
|
9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
+
|
11 |
+
COPY . .
|
12 |
+
|
13 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI, Response, status
|
2 |
+
|
3 |
+
app = FastAPI(docs_url='/', title='Test PyTorch COCO Object Detection')
|
4 |
+
|
5 |
+
|
6 |
+
@app.get('/healthcheck')
|
7 |
+
async def healthcheck():
|
8 |
+
return Response(status_code=status.HTTP_200_OK)
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
fastapi
|
2 |
+
uvicorn
|