From 696bffc41fd229ae73f1ee518893907d822371ba Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 7 Jun 2023 15:24:33 +0800 Subject: [PATCH] fix --- Dockerfile | 3 +-- app/main.py | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f7ead35e..ef0e5a0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM python:3.10.11-alpine3.17 -RUN apk update && apk add gcc +FROM python:3.10.11-slim ENV LANG="C.UTF-8" \ TZ="Asia/Shanghai" \ PS1="\u@\h:\w \$ " \ diff --git a/app/main.py b/app/main.py index 32fa24e1..9f20aadd 100644 --- a/app/main.py +++ b/app/main.py @@ -1,6 +1,12 @@ +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