FROM python:3.9 WORKDIR /app # Create a directory for the cache RUN mkdir -p /app/cache && chmod 777 /app/cache # Set the TRANSFORMERS_CACHE environment variable ENV TRANSFORMERS_CACHE=/app/cache COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . # Use Gunicorn to run the Flask app CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]