From 7eefe15db67edcc984af274bf9388f60f41d6355 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Wed, 9 Apr 2025 13:47:48 +0800 Subject: [PATCH] update --- Dockerfile | 2 +- app/main.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 app/main.py 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