feat: 初始化项目
This commit is contained in:
19
Dockerfile
Normal file
19
Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
# 1、从官方 Python 基础镜像开始
|
||||
FROM python:3.9
|
||||
|
||||
# 2、将当前工作目录设置为 /code
|
||||
# 这是放置 requirements.txt 文件和应用程序目录的地方
|
||||
WORKDIR /code
|
||||
|
||||
# 3、先复制 requirements.txt 文件
|
||||
# 由于这个文件不经常更改,Docker 会检测它并在这一步使用缓存,也为下一步启用缓存
|
||||
COPY ./requirements.txt /code/requirements.txt
|
||||
|
||||
# 4、运行 pip 命令安装依赖项
|
||||
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
||||
|
||||
# 5、复制 FastAPI 项目代码
|
||||
COPY ./app /code/app
|
||||
|
||||
# 6、运行服务
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
|
||||
BIN
__pycache__/main.cpython-310.pyc
Normal file
BIN
__pycache__/main.cpython-310.pyc
Normal file
Binary file not shown.
8
app/main.py
Normal file
8
app/main.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"message": "Hello World"}
|
||||
76
requirements.txt
Normal file
76
requirements.txt
Normal file
@@ -0,0 +1,76 @@
|
||||
aiofiles==0.8.0
|
||||
aiosqlite==0.17.0
|
||||
anyio==3.5.0
|
||||
asgiref==3.5.0
|
||||
autopep8==2.0.0
|
||||
bcrypt==3.2.0
|
||||
beautifulsoup4==4.11.1
|
||||
betterproto==1.2.5
|
||||
blinker==1.4
|
||||
certifi==2022.6.15
|
||||
cffi==1.15.0
|
||||
charset-normalizer==2.0.12
|
||||
click==8.1.3
|
||||
cryptography==37.0.1
|
||||
dnspython==2.2.1
|
||||
email-validator==1.1.3
|
||||
fastapi==0.75.2
|
||||
fastapi-crudrouter==0.8.5
|
||||
fastapi-users==9.3.1
|
||||
fastapi-users-db-sqlalchemy==3.0.1
|
||||
future==0.18.2
|
||||
greenlet==1.1.2
|
||||
grpclib==0.4.2
|
||||
h11==0.13.0
|
||||
h2==4.1.0
|
||||
hpack==4.0.0
|
||||
hypercorn==0.13.2
|
||||
hyperframe==6.0.1
|
||||
idna==3.3
|
||||
itchat==1.2.32
|
||||
itchat-uos==1.4.1
|
||||
itsdangerous==2.1.2
|
||||
Jinja2==3.1.2
|
||||
lxml==4.8.0
|
||||
makefun==1.13.1
|
||||
MarkupSafe==2.1.1
|
||||
multidict==6.0.2
|
||||
opengraph-py3==0.71
|
||||
passlib==1.7.4
|
||||
pikachuwechat==0.1.2
|
||||
ping3==4.0.3
|
||||
prettytable==3.3.0
|
||||
priority==2.0.0
|
||||
pycodestyle==2.10.0
|
||||
pycparser==2.21
|
||||
pydantic==1.9.0
|
||||
pyecharts==1.9.1
|
||||
pyee==9.0.4
|
||||
PyJWT==2.3.0
|
||||
pypng==0.0.21
|
||||
PyQRCode==1.2.1
|
||||
python-multipart==0.0.5
|
||||
qrcode==7.3.1
|
||||
quart==0.17.0
|
||||
requests==2.27.1
|
||||
simplejson==3.17.6
|
||||
six==1.16.0
|
||||
sniffio==1.2.0
|
||||
soupsieve==2.3.2.post1
|
||||
SQLAlchemy==1.4.36
|
||||
starlette==0.17.1
|
||||
stringcase==1.2.0
|
||||
toml==0.10.2
|
||||
tomli==2.0.1
|
||||
typing_extensions==4.2.0
|
||||
urllib3==1.26.9
|
||||
uvicorn==0.17.6
|
||||
wcwidth==0.2.5
|
||||
websockets==10.3
|
||||
wechaty==0.8.39
|
||||
wechaty-grpc==0.20.19
|
||||
wechaty-puppet==0.4.11
|
||||
wechaty-puppet-service==0.8.9
|
||||
Werkzeug==2.1.2
|
||||
wsproto==1.1.0
|
||||
wxpy==0.3.9.8
|
||||
Reference in New Issue
Block a user