From 7bccd3cec1875c75921d143be23c89f07a04f5a3 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 7 Jun 2023 15:29:52 +0800 Subject: [PATCH] fix build --- Dockerfile | 2 ++ app/main.py | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index ef0e5a0d..f0cbde23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,8 @@ ENV LANG="C.UTF-8" \ WORKDIR ${WORKDIR} COPY . . RUN pip install cython && pip install -r requirements.txt \ + && python_ver=$(python3 -V | awk '{print $2}') \ + && echo "${WORKDIR}/" > /usr/lib/python${python_ver%.*}/site-packages/app.pth \ && echo 'fs.inotify.max_user_watches=5242880' >> /etc/sysctl.conf \ && echo 'fs.inotify.max_user_instances=5242880' >> /etc/sysctl.conf EXPOSE 3001 diff --git a/app/main.py b/app/main.py index 9f20aadd..32fa24e1 100644 --- a/app/main.py +++ b/app/main.py @@ -1,12 +1,6 @@ -import sys -from pathlib import Path - import uvicorn as uvicorn from fastapi import FastAPI -# 将项目根目录添加到模块搜索路径 -sys.path.append(str(Path(__file__).parent.absolute())) - from app.api.apiv1 import api_router from app.core import settings, ModuleManager, PluginManager from app.db.init import init_db, update_db