leezhuuu commited on
Commit
76c6d41
·
verified ·
1 Parent(s): 42c5163

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -2
Dockerfile CHANGED
@@ -8,10 +8,16 @@ RUN apt-get update && apt-get install -y \
8
  curl \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # 1. 先拷贝 requirements 并安装,利用 Docker 缓存层
12
  COPY requirements.txt .
13
  RUN pip3 install --no-cache-dir -r requirements.txt
14
 
 
 
 
 
 
 
15
  # 2. 再拷贝源代码到 /app/src
16
  COPY src/ ./src/
17
 
@@ -21,5 +27,5 @@ EXPOSE 8501
21
  # 健康检查
22
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
23
 
24
- # 启动命令:注意路径指向 src/streamlit_app.py
25
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
8
  curl \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # 1. 拷贝 requirements 并安装
12
  COPY requirements.txt .
13
  RUN pip3 install --no-cache-dir -r requirements.txt
14
 
15
+ # ==========================================
16
+ # 👇 关键修改:显式拷贝数据文件到容器根目录 (/app)
17
+ # 注意:文件必须位于 Space 仓库的根目录下
18
+ COPY comsol_embedded.parquet .
19
+ # ==========================================
20
+
21
  # 2. 再拷贝源代码到 /app/src
22
  COPY src/ ./src/
23
 
 
27
  # 健康检查
28
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
29
 
30
+ # 启动命令
31
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]