Initial commit: Productionized Swarm with Docker support

This commit is contained in:
Nathan
2026-04-16 16:46:24 +10:00
committed by Nathan
commit ea4c11e32f
39 changed files with 331 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04
# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
# 1. Install Python 3.12 and SoX dependencies
RUN apt-get update && apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa -y && \
apt-get update && apt-get install -y \
python3.12 \
python3.12-dev \
curl \
git \
libsndfile1 \
ffmpeg \
sox \
libsox-dev && \
rm -rf /var/lib/apt/lists/*
# 2. Use the official bootstrap to install a clean Pip for 3.12
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12
WORKDIR /app
# 3. Explicitly install BOTH torch and torchaudio from the cu124 index
RUN python3.12 -m pip install --no-cache-dir torch==2.6.0 torchaudio --index-url https://download.pytorch.org/whl/cu124
RUN python3.12 -m pip install --no-cache-dir fastapi uvicorn numpy soundfile
# 4. Install the local Qwen3-TTS requirements
RUN python3.12 -m pip install --no-cache-dir faster-qwen3-tts
COPY tts-server.py .
EXPOSE 8002
CMD ["python3.12", "tts-server.py"]