From 360e27457b5a200de53829febdee1a5c282fcd4c Mon Sep 17 00:00:00 2001 From: eric Date: Wed, 14 Dec 2022 14:08:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 19 ++++++++ __pycache__/main.cpython-310.pyc | Bin 0 -> 334 bytes app/main.py | 8 ++++ requirements.txt | 76 +++++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+) create mode 100644 Dockerfile create mode 100644 __pycache__/main.cpython-310.pyc create mode 100644 app/main.py create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1f2230c --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/__pycache__/main.cpython-310.pyc b/__pycache__/main.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ea4f34e06dc6c0971e39ca38a45f5c75dc0960d GIT binary patch literal 334 zcmYjLJ5B>J5cSym6A;conQh_=AOr{@Xd)zpB5h~ZL$tz+EqhZy1qzp-gOYP_3%68U zfFc!RKuVr8&-2DJ^Tv)wTa561{L(Jy{Y+vLg2W+37!zrx!LS}00EVz+4M+YeG=Bpv zboR`a&}2HlWOeaH-K>UKo~ke$U7W8#wyCrUPU3?iqzj%vgXSI3u$acO#}L#UAGXiX z7`r#K-spGcbLw2vYAmk;`XJGFtvtbSJ6I=g$Wgg&hSzc;d)3`d+1 literal 0 HcmV?d00001 diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..ee60be1 --- /dev/null +++ b/app/main.py @@ -0,0 +1,8 @@ +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/") +async def root(): + return {"message": "Hello World"} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9558a21 --- /dev/null +++ b/requirements.txt @@ -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