Spaces:
Sleeping
Sleeping
| FROM python:3.10-slim | |
| # Set environment variables | |
| ENV HF_HOME=/data/huggingface | |
| ENV PYANNOTE_CACHE=/data/huggingface | |
| ENV MPLCONFIGDIR=/tmp/matplotlib | |
| ENV PATH="/root/.local/bin:$PATH" | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| ffmpeg git wget libsndfile1 libopenblas-dev build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create cache and tmp directories with appropriate permissions | |
| RUN mkdir -p /data/huggingface /tmp/matplotlib && chmod -R 777 /data /tmp | |
| # Copy requirements file | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --upgrade pip \ | |
| && pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu | |
| # Copy application files | |
| COPY . . | |
| # Expose port | |
| EXPOSE 7860 | |
| # Run app using gunicorn | |
| CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "1800", "app:app"] |