FROM python:3.11-slim WORKDIR /app # Set writable cache directory ENV TRANSFORMERS_CACHE=/tmp/cache ENV SENTENCE_TRANSFORMERS_HOME=/tmp/cache ENV HF_HOME=/tmp/cache # Create cache directory RUN mkdir -p /tmp/cache && chmod 777 /tmp/cache COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY app.py . EXPOSE 7860 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]