# 1. Base Image FROM python:3.11-slim # 2. Set the working directory WORKDIR /app # 3. Install PyTorch (CPU version) FIRST from its custom index RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu # 4. Install API dependencies SECOND from the normal Python index RUN pip install --no-cache-dir fastapi uvicorn transformers pillow pydantic requests # 5. Pre-download the NEW SigLIP deepfake model RUN python -c "from transformers import pipeline; pipeline('image-classification', model='prithivMLmods/deepfake-detector-model-v1')" # 6. Copy your app.py specifically into the current WORKDIR (/app) COPY app.py /app/app.py # 7. Set environment variable to make sure Python finds the /app folder ENV PYTHONPATH=/app # 8. Expose port EXPOSE 7860 # 9. Start the node CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]