Spaces:
Sleeping
Sleeping
| # Dockerfile for Youtube-Whisper | |
| # Production-ready Gradio application with audio processing | |
| FROM python:3.10-slim | |
| # Install system dependencies | |
| # ffmpeg: Required for audio/video processing | |
| # curl: For health checks | |
| RUN apt-get update && apt-get install -y \ | |
| ffmpeg \ | |
| curl \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create non-root user | |
| RUN useradd -m -u 1000 appuser && \ | |
| mkdir -p /app && \ | |
| chown -R appuser:appuser /app | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy requirements and install dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code with correct ownership | |
| COPY --chown=appuser:appuser . . | |
| # Switch to non-root user | |
| USER appuser | |
| # Expose Gradio port | |
| EXPOSE 7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | |
| CMD curl -f http://localhost:7860/ || exit 1 | |
| # Run Gradio app | |
| # Gradio automatically binds to 0.0.0.0 by default | |
| CMD ["python", "app.py"] |