FROM continuumio/miniconda3 WORKDIR /code # Install system dependencies RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/* # Install all dependencies via Conda (uses pre-compiled binaries) # This is much faster and more reliable than pip on Hugging Face RUN conda install -y -c conda-forge \ dlib \ face_recognition \ pillow-heif \ fastapi \ uvicorn \ python-multipart \ requests \ google-auth \ google-auth-oauthlib \ google-api-python-client \ numpy \ python-multipart \ && conda clean -afy # Install Firebase Admin via pip (not always in conda-forge) RUN pip install firebase-admin # Copy app code COPY . /code # Create DB file (Note: HF Spaces may be read-only at runtime except for /tmp) RUN touch /code/facematch.db && chmod 777 /code/facematch.db # Command to run the app CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]