FROM python:3.11-slim # Set a writable Hugging Face cache directory ENV TRANSFORMERS_CACHE=/tmp/huggingface WORKDIR /app # Copy and install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of your app COPY . . # Run the app CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]