34 lines
1.2 KiB
Docker
34 lines
1.2 KiB
Docker
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV NVIDIA_VISIBLE_DEVICES=all
|
|
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
|
|
|
# No deadsnakes PPA needed. Native Python 3.10 works perfectly.
|
|
RUN apt-get update && apt-get install -y \
|
|
python3 python3-dev python3-pip curl git libsndfile1 ffmpeg sox libsox-dev ninja-build && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Install Torch and core packages
|
|
RUN python3 -m pip install --no-cache-dir torch==2.6.0 torchaudio --index-url https://download.pytorch.org/whl/cu124
|
|
|
|
# 1. Install foundational build tools and numpy first
|
|
RUN python3 -m pip install --no-cache-dir numpy setuptools wheel ninja packaging psutil
|
|
|
|
# 2. Install the rest of the stack that relies on numpy being present
|
|
RUN python3 -m pip install --no-cache-dir fastapi uvicorn soundfile librosa transformers==4.57.3 accelerate sox onnxruntime
|
|
|
|
# Force ABI compatibility for the C++ compiler
|
|
ENV _GLIBCXX_USE_CXX11_ABI=0
|
|
ENV MAX_JOBS=8
|
|
|
|
# Install flash-attn
|
|
RUN python3 -m pip install --no-cache-dir flash-attn --no-build-isolation
|
|
|
|
COPY swarm-control/indra-tts-server/tts-server.py .
|
|
|
|
EXPOSE 8002
|
|
CMD ["python3", "tts-server.py"]
|