# Use Official Python Image FROM python:3.9 # Set Working Directory WORKDIR /app # Copy Files COPY requirements.txt requirements.txt COPY app.py app.py # ✅ Create Writable Cache Directory RUN mkdir -p /app/cache && chmod -R 777 /app/cache ENV TRANSFORMERS_CACHE="/app/cache" ENV HF_HOME="/app/cache" # Install Dependencies RUN pip install --no-cache-dir -r requirements.txt # Expose Port 7860 (Required by Hugging Face) EXPOSE 7860 # Start FastAPI Server CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]