Spaces:
Sleeping
Sleeping
| # Use Python 3.9 slim as base image | |
| FROM python:3.9-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| ffmpeg \ | |
| libsndfile1 \ | |
| libsndfile1-dev \ | |
| libasound2-dev \ | |
| libportaudio2 \ | |
| libportaudiocpp0 \ | |
| portaudio19-dev \ | |
| build-essential \ | |
| pkg-config \ | |
| libavcodec-dev \ | |
| libavformat-dev \ | |
| libswscale-dev \ | |
| libgstreamer1.0-dev \ | |
| libgstreamer-plugins-base1.0-dev \ | |
| libgtk-3-dev \ | |
| libpng-dev \ | |
| libjpeg-dev \ | |
| libopenexr-dev \ | |
| libtiff-dev \ | |
| libwebp-dev \ | |
| git \ | |
| wget \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first for better caching | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY . . | |
| # Create directory for model file | |
| RUN mkdir -p /app/models | |
| # Expose port | |
| EXPOSE 8000 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ | |
| CMD curl -f http://localhost:8000/health || exit 1 | |
| # Run the application | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"] |