Spaces:
Sleeping
Sleeping
Ronio Jerico Roque commited on
Commit ·
b99cd1e
1
Parent(s): 9cc761f
initial commit
Browse files- Dockerfile +10 -0
- app.py +18 -0
- requirements.txt +4 -0
Dockerfile
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
COPY requirements.txt .
|
| 6 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 7 |
+
|
| 8 |
+
COPY . .
|
| 9 |
+
|
| 10 |
+
CMD python app.py
|
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from fastapi import FastAPI
|
| 3 |
+
|
| 4 |
+
app = FastAPI()
|
| 5 |
+
|
| 6 |
+
@app.get("/")
|
| 7 |
+
async def read_root():
|
| 8 |
+
return {"message": "Hello from the root!"}
|
| 9 |
+
|
| 10 |
+
@app.get("/test")
|
| 11 |
+
async def read_test():
|
| 12 |
+
return {"message": "Hello from the test endpoint!"}
|
| 13 |
+
|
| 14 |
+
if __name__ == "__main__":
|
| 15 |
+
import uvicorn
|
| 16 |
+
# Use the PORT environment variable provided by Hugging Face, default to 7860
|
| 17 |
+
port = int(os.environ.get("PORT", "7860"))
|
| 18 |
+
uvicorn.run(app, host="0.0.0.0", port=port)
|
requirements.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi
|
| 2 |
+
uvicorn
|
| 3 |
+
fastapi-mcp
|
| 4 |
+
pydantic
|