FROM python:3.10.12 # Set environment variables ENV PYTHONUNBUFFERED 1 ENV HF_HOME=/app/.huggingface_cache # Create a directory for the Hugging Face cache RUN mkdir -p /app/.huggingface_cache WORKDIR /src COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Set the appropriate permissions for the HuggingFace cache directory RUN chmod -R 777 /app/.huggingface_cache COPY . . EXPOSE 7860 CMD ["gunicorn", "--workers", "1", "--bind", "0.0.0.0:7860", "app:app"]