MarioPrzBasto commited on
Commit
51c00f9
·
1 Parent(s): ff51bdc

Add application file

Browse files
Files changed (2) hide show
  1. Dockerfile +4 -5
  2. main.py +3 -3
Dockerfile CHANGED
@@ -1,11 +1,10 @@
1
  FROM python:3.9
2
 
3
- WORKDIR /app
4
 
5
- COPY requirements.txt .
6
 
7
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
8
 
9
- COPY ./*.py /app/
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 root():
7
- return "oi"
 
2
 
3
  app = FastAPI()
4
 
5
+ @app.get("/", tags=["Home"])
6
+ def api_home():
7
+ return {'detail': 'Welcome to FastAPI TextGen Tutorial!'}