Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- 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
|
| 15 |
|
| 16 |
# ========= 暴露 Streamlit 端口 =========
|
| 17 |
EXPOSE 8501
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
# ========= 启动命令 =========
|
| 20 |
-
CMD ["streamlit", "run", "
|
|
|
|
| 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"]
|