Spaces:
Runtime error
Runtime error
Upload 4 files
Browse files- Dockerfile +12 -0
- app/__init__.py +0 -0
- app/main.py +7 -0
- requirements.txt +2 -0
Dockerfile
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
FROM python:3.9
|
3 |
+
|
4 |
+
WORKDIR /code
|
5 |
+
|
6 |
+
COPY ./requirements.txt /code/requirements.txt
|
7 |
+
|
8 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
9 |
+
|
10 |
+
COPY ./app /code/app
|
11 |
+
|
12 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
app/__init__.py
ADDED
File without changes
|
app/main.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
|
3 |
+
app = FastAPI()
|
4 |
+
|
5 |
+
@app.get("/items/{name}")
|
6 |
+
async def say_hello(name):
|
7 |
+
return {"message": f"Hello {name}!"}
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
fastapi>=0.68.0,<0.69.0
|
2 |
+
uvicorn>=0.15.0,<0.16.0
|