ElvisWang111 commited on
Commit
4d4f935
·
verified ·
1 Parent(s): 5d19037

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -3
Dockerfile CHANGED
@@ -5,16 +5,18 @@ FROM python:3.12-slim
5
  WORKDIR /app
6
 
7
  # ========= 安装依赖 =========
8
- # 先复制 requirements.txt 再安装,避免频繁重建层
9
  COPY ./requirements.txt ./requirements.txt
10
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
11
  && pip install --no-cache-dir -r requirements.txt
12
 
13
  # ========= 拷贝项目文件 =========
14
- COPY tmp/ ./
15
 
16
  # ========= 暴露 Streamlit 端口 =========
17
  EXPOSE 8501
18
 
 
 
 
19
  # ========= 启动命令 =========
20
- CMD ["streamlit", "run", "tmp/app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
5
  WORKDIR /app
6
 
7
  # ========= 安装依赖 =========
 
8
  COPY ./requirements.txt ./requirements.txt
9
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
10
  && pip install --no-cache-dir -r requirements.txt
11
 
12
  # ========= 拷贝项目文件 =========
13
+ COPY . /app
14
 
15
  # ========= 暴露 Streamlit 端口 =========
16
  EXPOSE 8501
17
 
18
+ # ========= 健康检查 =========
19
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
20
+
21
  # ========= 启动命令 =========
22
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]