Download Dockerfile from Vampont/NVH: direct link, hf CLI and curl.
- Browser
- Download file 746 Bytes
-
https://huggingface.co/spaces/Vampont/NVH/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Vampont/NVH/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Vampont/NVH/resolve/main/Dockerfile
746 Bytes
| FROM python:3.11-slim | |
| # 系统依赖:ffmpeg 用于解码 mp4 / mov / mp3 等 | |
| RUN apt-get update \ | |
| && apt-get install -y --no-install-recommends ffmpeg \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # HuggingFace Spaces 要求非 root 用户 | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" \ | |
| PYTHONUNBUFFERED=1 \ | |
| NVH_WORK_DIR=/tmp/nvh | |
| WORKDIR /home/user/app | |
| COPY --chown=user:user requirements.txt . | |
| RUN pip install --no-cache-dir --user -r requirements.txt | |
| COPY --chown=user:user . . | |
| EXPOSE 7860 | |
| # 单进程多线程足够:Flask 端用 threading 跑分析;多 worker 反而吃光免费实例内存 | |
| CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--threads", "4", "--timeout", "300", "app:app"] | |