Dockerfile
1 FROM python:3.11-slim 2 3 WORKDIR /app 4 5 RUN apt-get update && apt-get install -y --no-install-recommends \ 6 libsndfile1 \ 7 git \ 8 && rm -rf /var/lib/apt/lists/* 9 10 # Install PyTorch CPU-only 11 RUN pip install --no-cache-dir \ 12 torch torchaudio --index-url https://download.pytorch.org/whl/cpu 13 14 # Install CAM++ dependencies 15 RUN pip install --no-cache-dir \ 16 numpy \ 17 scipy \ 18 pyyaml \ 19 soundfile \ 20 modelscope 21 22 # 3D-Speaker for CAMPPlus model class 23 RUN git clone --depth 1 https://github.com/modelscope/3D-Speaker.git /opt/3d-speaker 24 ENV PYTHONPATH="/opt/3d-speaker" 25 26 COPY service.py enroll.html ./ 27 28 EXPOSE 10800 29 30 CMD ["python", "service.py"]