FROM nvidia/cuda:12.1.0-base-ubuntu22.04 # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ python3.11 \ python3-pip \ ffmpeg \ libsndfile1 \ sox \ libsox-dev \ libsox-fmt-all \ && rm -rf /var/lib/apt/lists/* # Copy requirements COPY requirements.txt . # Upgrade pip to avoid dependency resolution issues RUN pip3 install --upgrade pip # Install dependencies for sox package (required by NeMo) in correct order RUN pip3 install --no-cache-dir numpy==2.2.2 typing-extensions # Install Python dependencies with legacy resolver (NeMo has complex dependencies) RUN pip3 install --no-cache-dir --use-deprecated=legacy-resolver -r requirements.txt # Copy application code COPY . . # Create models directory RUN mkdir -p /models # Expose port EXPOSE 8000 # Set environment variables ENV PYTHONUNBUFFERED=1 ENV CUDA_VISIBLE_DEVICES=0 ENV LD_LIBRARY_PATH=/usr/local/lib/python3.11/dist-packages/nvidia/cudnn/lib:${LD_LIBRARY_PATH} # Run the server CMD ["uvicorn", "stt_server:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "info"]