Spaces:
Sleeping
Sleeping
Download Dockerfile from ZevonLew/Image_Recognition: direct link, hf CLI and curl.
- Browser
- Download file 871 Bytes
-
https://huggingface.co/spaces/ZevonLew/Image_Recognition/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/ZevonLew/Image_Recognition/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/ZevonLew/Image_Recognition/resolve/main/Dockerfile
871 Bytes
| # 浏览器缺少WebGL时由Space CPU运行原MediaPipe模型,不需要GPU硬件。 | |
| FROM python:3.11-slim-bookworm | |
| ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 MPLCONFIGDIR=/tmp/matplotlib | |
| RUN apt-get update && apt-get install -y --no-install-recommends libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY requirements.txt ./requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 只复制教学页面和运行资源,避免将Git、旧项目、备份或本地数据带入公开服务。 | |
| COPY server.py index.html app.js recognizers.js style.css how-to-start.html how-to-start.pdf THIRD_PARTY_NOTICES.md ./ | |
| COPY vendor ./vendor | |
| COPY models ./models | |
| COPY samples ./samples | |
| RUN useradd -m -u 1000 appuser | |
| USER appuser | |
| EXPOSE 7860 | |
| CMD ["python", "-m", "uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860", "--no-access-log"] | |