Liuli commited on
Commit
a2f32df
1 Parent(s): cd3563b
.vscode/launch.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ // 使用 IntelliSense 了解相关属性。
3
+ // 悬停以查看现有属性的描述。
4
+ // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Python: FastAPI",
9
+ "type": "python",
10
+ "request": "launch",
11
+ "module": "uvicorn",
12
+ "args": [
13
+ "app.main:app"
14
+ ],
15
+ "jinja": true,
16
+ "justMyCode": true
17
+ }
18
+ ]
19
+ }
Dockerfile ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ WORKDIR /code
4
+
5
+ RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
6
+
7
+ COPY ./requirements.txt /code/requirements.txt
8
+
9
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
+
11
+
12
+
13
+ COPY . .
14
+
15
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
app/__pycache__/main.cpython-39.pyc ADDED
Binary file (354 Bytes). View file
 
app/main.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+
3
+ app = FastAPI()
4
+
5
+ @app.get("/")
6
+ async def root():
7
+ return {"message": "Hello World"}
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ fastapi