FROM python:3.9-slim WORKDIR /app # System dependencies for face_recognition RUN apt-get update && apt-get install -y \ build-essential \ cmake \ libsm6 \ libxext6 \ libxrender-dev \ libgl1-mesa-glx \ git \ curl \ && apt-get clean && rm -rf /var/lib/apt/lists/* # Create necessary directories RUN mkdir -p uploaded_images RUN mkdir -p static RUN mkdir -p models RUN mkdir -p uploaded_videos # Install Python requirements RUN pip install fastapi uvicorn python-multipart face-recognition opencv-python-headless matplotlib torch torchvision numpy pillow # Download model from Hugging Face RUN pip install huggingface_hub RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='tayyabimam/Deepfake', filename='model.pt', local_dir='/app/models')" # Copy app.py COPY app.py ./ # Expose the port EXPOSE 7860 # Start the server CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]