Spaces:
Paused
Paused
Download Dockerfile from afghan50002/alam: direct link, hf CLI and curl.
- Browser
- Download file 1.31 kB
-
https://huggingface.co/spaces/afghan50002/alam/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/afghan50002/alam/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/afghan50002/alam/resolve/main/Dockerfile
1.31 kB
| FROM python:3.11-slim | |
| # Install system dependencies for dlib/face_recognition | |
| # Install system dependencies for dlib/face_recognition | |
| # Install system dependencies for dlib/face_recognition | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| cmake \ | |
| build-essential \ | |
| libopenblas-dev \ | |
| liblapack-dev \ | |
| libx11-dev \ | |
| libglib2.0-0 \ | |
| libgl1 \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Speed up dlib C++ compilation with parallel build | |
| ENV CMAKE_BUILD_PARALLEL_LEVEL=4 | |
| # Install dlib FIRST as separate layer (longest step, gets cached) | |
| RUN pip install --no-cache-dir dlib==20.0.1 | |
| # Install face_recognition_models from GitHub (avoids pkg_resources issue) | |
| RUN pip install --no-cache-dir git+https://github.com/ageitgey/face_recognition_models | |
| # Install remaining Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY . . | |
| # Set working directory to the Flask app | |
| WORKDIR /app/face_attendance_web | |
| # Create faces and logs directories | |
| RUN mkdir -p faces logs | |
| # Hugging Face Spaces uses port 7860 | |
| EXPOSE 7860 | |
| # Run with gunicorn on port 7860 | |
| CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--timeout", "120", "app:app"] | |