Jelajahi Sumber

配置文件目录调整

lingmin_package@163.com 1 bulan lalu
induk
melakukan
b96a6b8137

+ 4 - 4
backend/config.py

@@ -22,17 +22,17 @@ def get_config_path() -> Path:
     base_path = Path(__file__).parent
 
     if app_env == "prod":
-        config_file = base_path / "config.prod.yaml"
+        config_file = base_path / "config/config.prod.yaml"
         logger.info("使用生产环境配置: config.prod.yaml")
     elif app_env == "test":
-        config_file = base_path / "config.test.yaml"
+        config_file = base_path / "config/config.test.yaml"
         logger.info("使用测试环境配置: config.test.yaml")
     elif app_env == "dev":
-        config_file = base_path / "config.dev.yaml"
+        config_file = base_path / "config/config.dev.yaml"
         logger.info("使用开发环境配置: config.dev.yaml")
     else:
         print("默认使用开发环境")
-        config_file = base_path / "config.dev.yaml"
+        config_file = base_path / "config/config.dev.yaml"
         if app_env:
             logger.warning(f"未知的 APP_ENV 值: {app_env},使用默认 config.dev.yaml")
 

+ 0 - 0
backend/config.dev.yaml → backend/config/config.dev.yaml


+ 0 - 0
backend/config.prod.yaml → backend/config/config.prod.yaml


+ 0 - 0
backend/config.test.yaml → backend/config/config.test.yaml


+ 0 - 0
backend/docker-compose.yml → backend/docker/docker-compose.bak.yml


+ 38 - 0
backend/docker/docker-compose.yml

@@ -0,0 +1,38 @@
+# 标注平台后端 Docker Compose 配置
+version: '3.8'
+
+
+services:
+  LQAdminServer:
+    image: lq_label_server:v0.01
+    container_name: LQLabelServer
+    restart: unless-stopped
+    
+    volumes:
+      # 挂载代码目录(代码更新无需重新构建镜像)
+      - /home/lq/lq_workspace/LQLabelServer/app/config:/app/config:rw
+      # 挂载导出文件目录
+      - /home/lq/lq_workspace/LQLabelServer/app/exports:/app/exports
+    environment:
+      - TZ=Asia/Shanghai  # 设置时区为上海(北京时间)
+    ports:
+      - "0.0.0.0:8003:8003"
+    healthcheck:
+      test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8003/health')"]
+      interval: 30s
+      timeout: 10s
+      retries: 3
+      start_period: 10s
+    networks:
+      - lq_network
+    
+
+networks:
+  lq_network:
+    external: true     
+
+
+# 数据卷定义
+volumes:
+  backend-data:
+    driver: local