Spaces:
Build error
Build error
| # Enhanced Audio Separator Demo - Docker Configuration | |
| # Supports both CPU and GPU acceleration | |
| # Base image with Python and system dependencies | |
| FROM python:3.11-slim | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV PYTHONPATH=/app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| ffmpeg \ | |
| libsndfile1 \ | |
| libsndfile1-dev \ | |
| libasound2-dev \ | |
| portaudio19-dev \ | |
| python3-pyaudio \ | |
| curl \ | |
| wget \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy requirements first for better caching | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY . . | |
| # Create directories for models and outputs | |
| RUN mkdir -p /tmp/audio-separator-models /app/outputs | |
| # Set environment variables for model directory | |
| ENV AUDIO_SEPARATOR_MODEL_DIR=/tmp/audio-separator-models | |
| # Expose port for Gradio | |
| EXPOSE 7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ | |
| CMD curl -f http://localhost:7860/ || exit 1 | |
| # Run the application | |
| CMD ["python", "app.py"] |