FROM python:3.10-slim WORKDIR /app # Redirect HF cache to a writable folder ENV HF_HOME=/app/.cache/huggingface ENV TRANSFORMERS_CACHE=$HF_HOME # Create cache dir RUN mkdir -p $HF_HOME \ && chmod -R 777 $HF_HOME # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy your app code COPY . . # Expose and run EXPOSE 7860 CMD ["python", "app.py"]