| |
| FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04 |
|
|
| |
| ENV PYTHONUNBUFFERED=1 \ |
| DEBIAN_FRONTEND=noninteractive \ |
| CUDA_HOME=/usr/local/cuda \ |
| PATH=/usr/local/cuda/bin:$PATH \ |
| LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH \ |
| NVIDIA_VISIBLE_DEVICES=all \ |
| NVIDIA_DRIVER_CAPABILITIES=compute,utility \ |
| HF_HOME=/app/models \ |
| NUMBA_CACHE_DIR=/tmp/numba_cache \ |
| MODEL_PORT=10000 \ |
| API_PORT=8000 |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| python3 \ |
| python3-pip \ |
| python3-dev \ |
| build-essential \ |
| git \ |
| ffmpeg \ |
| libsndfile1 \ |
| libsox-fmt-all \ |
| libavcodec-extra \ |
| libsm6 \ |
| libxext6 \ |
| libxrender-dev \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN python3 -m pip install --upgrade pip setuptools wheel uv |
|
|
| WORKDIR /app |
|
|
| |
| RUN mkdir -p /tmp/numba_cache && \ |
| chmod 777 /tmp/numba_cache && \ |
| mkdir -p /app/glm-4-voice-decoder && \ |
| mkdir -p /app/cosyvoice && \ |
| mkdir -p /app/third_party/Matcha-TTS |
|
|
| |
| COPY requirements.txt . |
| RUN python3 -m uv pip install --no-cache-dir -r requirements.txt --prerelease=allow && \ |
| python3 -m uv pip install \ |
| torchaudio==2.1.0+cu121 \ |
| flash-attn==2.5.0 \ |
| resampy==0.4.2 \ |
| soundfile==0.12.1 \ |
| --extra-index-url https://download.pytorch.org/whl/cu121 |
|
|
| |
| COPY . . |
|
|
| |
| RUN chmod +x /app/third_party/Matcha-TTS/setup.sh && \ |
| chmod -R 777 /tmp |
|
|
| |
| EXPOSE 8000 10000 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=30s --start-period=5m \ |
| CMD curl --fail http://localhost:8000/api/voice_chat || exit 1 |
|
|
| |
| CMD ["sh", "-c", \ |
| "python3 -m uvicorn server:app --host 0.0.0.0 --port $API_PORT & \ python3 -m uvicorn model_server:app --host 0.0.0.0 --port $MODEL_PORT"] |