sterlinsun commited on
Commit
8b82c58
·
verified ·
1 Parent(s): d7a68ad

Create requirements.txt

Browse files
Files changed (1) hide show
  1. requirements.txt +26 -0
requirements.txt ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fastapi
2
+ uvicorn[standard]
3
+ from fastapi import FastAPI
4
+
5
+ app = FastAPI()
6
+
7
+ @app.get("/")
8
+ def greet_json():
9
+ return {"Hello": "World!"}
10
+ # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
11
+ # you will also find guides on how best to write your Dockerfile
12
+
13
+ FROM python:3.9
14
+
15
+ RUN useradd -m -u 1000 user
16
+ USER user
17
+ ENV PATH="/home/user/.local/bin:$PATH"
18
+
19
+ WORKDIR /app
20
+
21
+ COPY --chown=user ./requirements.txt requirements.txt
22
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
23
+
24
+ COPY --chown=user . /app
25
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
26
+ git add requirements.txt app.py Dockerfile && git commit -m 'Add application file' && git push