Spaces:
Sleeping
Sleeping
Download Dockerfile from wuyan123258/Study: direct link, hf CLI and curl.
- Browser
- Download file 745 Bytes
-
https://huggingface.co/spaces/wuyan123258/Study/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/wuyan123258/Study/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/wuyan123258/Study/resolve/main/Dockerfile
745 Bytes
| FROM python:3.9-slim | |
| # 设置环境变量(国内镜像源加速下载) | |
| ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple \ | |
| PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn \ | |
| HF_ENDPOINT=https://hf-mirror.com | |
| WORKDIR /app | |
| # 先复制依赖文件(变化频率低) | |
| COPY requirements.txt . | |
| # 安装系统依赖并清理缓存(合并RUN指令减少层数) | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends ffmpeg && \ | |
| apt-get clean && \ | |
| rm -rf /var/lib/apt/lists/* /tmp/* | |
| # 安装Python依赖 | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # 最后复制应用代码(变化频率最高) | |
| COPY . . | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] |