Spaces:
Sleeping
Sleeping
Next7years
commited on
Commit
•
c303997
1
Parent(s):
b70cefb
sss
Browse files- Dockerfile +2 -10
- main.py +2 -2
Dockerfile
CHANGED
@@ -6,14 +6,6 @@ COPY ./requirements.txt /code/requirements.txt
|
|
6 |
|
7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
|
9 |
-
|
10 |
-
RUN useradd -m -u 1000 user
|
11 |
-
# Switch to the "user" user
|
12 |
-
USER user
|
13 |
-
# Set home to the user's home directory
|
14 |
-
ENV HOME=/home/user \
|
15 |
-
PATH=/home/user/.local/bin:$PATH
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
6 |
|
7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
|
9 |
+
COPY . .
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
main.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
|
3 |
|
4 |
-
|
5 |
|
6 |
-
@
|
7 |
def read_root():
|
8 |
return {"Hello": "World!"}
|
|
|
1 |
from fastapi import FastAPI
|
2 |
|
3 |
|
4 |
+
app = FastAPI()
|
5 |
|
6 |
+
@app.get("/")
|
7 |
def read_root():
|
8 |
return {"Hello": "World!"}
|