Spaces:
Sleeping
Sleeping
Commit
·
51c00f9
1
Parent(s):
ff51bdc
Add application file
Browse files- Dockerfile +4 -5
- main.py +3 -3
Dockerfile
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
-
|
4 |
|
5 |
-
|
6 |
|
7 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
8 |
|
9 |
-
|
10 |
|
11 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
+
COPY . .
|
4 |
|
5 |
+
WORKDIR /
|
6 |
|
7 |
+
RUN pip install --no-cache-dir --upgrade -r /requirements.txt
|
8 |
|
9 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
10 |
|
|
main.py
CHANGED
@@ -2,6 +2,6 @@ from fastapi import FastAPI
|
|
2 |
|
3 |
app = FastAPI()
|
4 |
|
5 |
-
@app.get("/")
|
6 |
-
def
|
7 |
-
return
|
|
|
2 |
|
3 |
app = FastAPI()
|
4 |
|
5 |
+
@app.get("/", tags=["Home"])
|
6 |
+
def api_home():
|
7 |
+
return {'detail': 'Welcome to FastAPI TextGen Tutorial!'}
|