This commit is contained in:
aaron 2025-04-09 13:47:48 +08:00
parent 0335b7f368
commit 7eefe15db6
2 changed files with 5 additions and 1 deletions

View File

@ -42,4 +42,4 @@ RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt \
EXPOSE 8000
# 启动命令
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]

4
app/main.py Normal file
View File

@ -0,0 +1,4 @@
# 从项目根目录导入应用实例
from main import app
# 使用uvicorn app.main:app启动时会使用这个导入的app实例