Refactor Docker setup and remove unused files
- Updated docker-compose.yml to rename backend and frontend container names for clarity. - Added volume mappings for frontend and backend services to persist data. - Removed obsolete files related to frequency response extraction, including Python scripts and output data files. - Adjusted backend port configuration in main.py to align with new service architecture. - Enhanced logging for file upload paths in models.py for better traceability.
This commit is contained in:
+1
-1
@@ -72,6 +72,6 @@ if __name__ == "__main__":
|
||||
uvicorn.run(
|
||||
"main:app",
|
||||
host="0.0.0.0",
|
||||
port=8002,
|
||||
port=8083,
|
||||
reload=False
|
||||
)
|
||||
|
||||
@@ -22,9 +22,13 @@ MEILISEARCH_API_KEY = os.getenv("MEILISEARCH_API_KEY", "")
|
||||
MEILISEARCH_INDEX = os.getenv("MEILISEARCH_INDEX", "models")
|
||||
|
||||
# 文件上传配置
|
||||
UPLOAD_FOLDER = Path(__file__).parent.parent.parent / "autoeq" / "measurements"
|
||||
UPLOAD_FOLDER = Path("/data/project/autoeq/measurements")
|
||||
ALLOWED_EXTENSIONS = {'.csv', '.txt', '.json'}
|
||||
|
||||
# 记录上传路径配置
|
||||
logger.info(f"UPLOAD_FOLDER configured as: {UPLOAD_FOLDER}")
|
||||
logger.info(f"UPLOAD_FOLDER absolute path: {UPLOAD_FOLDER.absolute()}")
|
||||
|
||||
|
||||
@router.get("/", response_model=ApiResponse)
|
||||
def get_models(
|
||||
@@ -104,6 +108,7 @@ def create_model(
|
||||
measurement_filename = None
|
||||
if measurement_file and measurement_file.filename:
|
||||
logger.info(f"Uploading measurement file: {measurement_file.filename}")
|
||||
logger.info(f"UPLOAD_FOLDER is: {UPLOAD_FOLDER}")
|
||||
# 验证文件扩展名
|
||||
file_ext = os.path.splitext(measurement_file.filename)[1].lower()
|
||||
if file_ext not in ALLOWED_EXTENSIONS:
|
||||
@@ -112,10 +117,12 @@ def create_model(
|
||||
|
||||
# 创建保存路径:autoeq/measurements/{source}/data/{form}/{filename}
|
||||
save_dir = UPLOAD_FOLDER / source / "data" / form
|
||||
logger.info(f"Creating directory: {save_dir}")
|
||||
save_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# 保存文件(保留原文件名)
|
||||
file_path = save_dir / measurement_file.filename
|
||||
logger.info(f"Saving file to: {file_path}")
|
||||
with open(file_path, "wb") as buffer:
|
||||
shutil.copyfileobj(measurement_file.file, buffer)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user