Ver Fonte

feat:测试docker compose热更新

zhaohaipeng há 1 semana atrás
pai
commit
7c8e6d8f58
2 ficheiros alterados com 5 adições e 5 exclusões
  1. 1 2
      app.py
  2. 4 3
      sorawm_start.sh

+ 1 - 2
app.py

@@ -21,8 +21,7 @@ def main():
     use_backend = st.sidebar.checkbox("使用后端服务 (FastAPI)", value=True)
     backend_url = st.sidebar.text_input(
         "后端地址",
-        # value="http://192.168.245.14:5344",
-        value="http://127.0.0.1:5344",
+        value="http://192.168.245.14:5344",
         help="FastAPI 服务的基础地址",
     )
 

+ 4 - 3
sorawm_start.sh

@@ -1,8 +1,9 @@
 #!/bin/bash
 
-# 安装uv依赖
-uv sync --frozen -i https://mirrors.aliyun.com/pypi/simple/
-
+# 安装uv依赖,如果不存在虚拟环境,则创建
+if [ ! -d "/app/.venv" ]; then
+  uv sync --frozen -i https://mirrors.aliyun.com/pypi/simple/
+fi
 # 激活环境
 source /app/.venv/bin/activate