diff --git a/Dockerfile b/Dockerfile index 6bac277..7e67fd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] \ No newline at end of file diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..702357a --- /dev/null +++ b/app/main.py @@ -0,0 +1,4 @@ +# 从项目根目录导入应用实例 +from main import app + +# 使用uvicorn app.main:app启动时会使用这个导入的app实例 \ No newline at end of file