Spaces:
Sleeping
Sleeping
| FROM python:3.11 | |
| WORKDIR /app | |
| # Set cache directories to writable locations | |
| ENV MPLCONFIGDIR=/tmp/matplotlib | |
| ENV HF_HOME=/tmp/huggingface | |
| ENV TORCH_HOME=/tmp/torch | |
| ENV TRANSFORMERS_CACHE=/tmp/transformers | |
| ENV NEMO_CACHE_DIR=/tmp/nemo | |
| # Fix Numba caching issues | |
| ENV NUMBA_CACHE_DIR=/tmp/numba_cache | |
| ENV NUMBA_DISABLE_JIT=0 | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| libsndfile1 \ | |
| ffmpeg \ | |
| git \ | |
| build-essential \ | |
| libssl-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application files | |
| COPY . . | |
| # Create all cache directories with proper permissions | |
| RUN mkdir -p /tmp/matplotlib /tmp/huggingface /tmp/torch /tmp/transformers /tmp/nemo /tmp/numba_cache && \ | |
| chmod -R 777 /tmp | |
| # Expose Hugging Face port | |
| EXPOSE 7860 | |
| # Environment variables | |
| ENV PYTHONUNBUFFERED=1 | |
| # Run app | |
| CMD ["python", "app.py"] |