Spaces:
Runtime error
Runtime error
| # Dockerfile for Nemotron Speech Streaming | |
| # FastAPI + WebSocket + NeMo ASR | |
| FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04 | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| DEBIAN_FRONTEND=noninteractive | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| python3.10 \ | |
| python3-pip \ | |
| python3.10-dev \ | |
| ffmpeg \ | |
| libsndfile1 \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set Python 3.10 as default | |
| RUN ln -sf /usr/bin/python3.10 /usr/bin/python3 && \ | |
| ln -sf /usr/bin/python3.10 /usr/bin/python | |
| WORKDIR /app | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY main.py . | |
| COPY static/ ./static/ | |
| # Create non-root user for security | |
| RUN useradd --create-home --shell /bin/bash appuser && \ | |
| chown -R appuser:appuser /app | |
| USER appuser | |
| # Expose port | |
| EXPOSE 7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ | |
| CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')" || exit 1 | |
| # Run the application | |
| CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |