Spaces:
Sleeping
Sleeping
| # Final, complete Dockerfile with all fixes | |
| FROM python:3.9-slim | |
| # Set environment variables to tell libraries where to store data | |
| ENV DEEPFACE_HOME /tmp | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y build-essential libgl1-mesa-glx libglib2.0-0 | |
| # Set the working directory | |
| WORKDIR /code | |
| # Copy all project files | |
| COPY ./requirements.txt /code/requirements.txt | |
| COPY ./app.py /code/app.py | |
| COPY ./verifier.py /code/verifier.py | |
| COPY ./templates /code/templates | |
| # Install Python requirements from the file | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Install PyTorch and Torchvision for DeepFace liveness detection | |
| RUN pip install --no-cache-dir torch torchvision | |
| # Expose the app port | |
| EXPOSE 7860 | |
| # Command to run the app with a timeout | |
| CMD ["gunicorn", "--workers", "1", "--threads", "4", "--timeout", "120", "--bind", "0.0.0.0:7860", "app:app"] | |