FROM python:3.9-slim WORKDIR /app # Install ffmpeg for audio processing RUN apt-get update && apt-get install -y ffmpeg && apt-get clean # Create a cache directory with proper permissions RUN mkdir -p /app/.cache && chmod 777 /app/.cache ENV TRANSFORMERS_CACHE=/app/.cache ENV HF_HOME=/app/.cache ENV SENTENCE_TRANSFORMERS_HOME=/app/.cache # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application COPY . . # Create necessary directories if they don't exist RUN mkdir -p /app/templates /app/static # Expose the port the app runs on EXPOSE 7860 # Start the Flask app CMD ["python", "-m", "flask", "run", "--host=0.0.0.0", "--port=7860"]