From 0b2d1b251ca905c43b7eb6490636bd4e0968e4be Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sun, 12 Jan 2025 15:23:45 -0500 Subject: [PATCH] Update Dockerfile --- Dockerfile | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 329e4b0..59c9a66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,9 @@ RUN \ python3-venv \ python3-pip \ ca-certificates \ + git \ + build-essential \ + cmake \ pkg-config WORKDIR /app @@ -42,13 +45,33 @@ RUN \ /app/bin/python3 -m pip install --no-cache-dir --force-reinstall --no-deps \ /tmp/piper_phonemize-${PIPER_PHONEMIZE_VERSION}-py3-none-any.whl &&\ \ + ln -s /app/lib/python3.10/site-packages/piper_phonemize /app/share &&\ + cp -rfv /app/lib/python3.10/site-packages/piper_phonemize.libs/* /app/lib/ &&\ + \ + LATEST_PIPER_VERSION=$(wget "https://api.github.com/repos/rhasspy/piper/releases/latest" -O -|awk '/tag_name/{print $4;exit}' FS='[""]') && \ + \ + wget "https://github.com/rhasspy/piper/releases/download/${LATEST_PIPER_VERSION}/piper_${TARGETARCH}.tar.gz" -O -|tar -zxvf - -C /usr/share &&\ + \ /app/bin/python3 -m pip install --no-cache-dir \ "wyoming-piper @ https://github.com/rhasspy/wyoming-piper/archive/refs/tags/v${WYOMING_PIPER_VERSION}.tar.gz" +WORKDIR /work + +RUN git clone https://github.com/rhasspy/piper.git . + +RUN cmake -Bbuild -DCMAKE_INSTALL_PREFIX=install -DPIPER_PHONEMIZE_DIR=/app +RUN cmake --build build --config Release +RUN cmake --install build + +RUN ./build/piper --help + +RUN mkdir -p /app/piper && \ + mv /work/install/lib*.so* /app/lib/ &&\ + cp -rf /work/install/* /app/piper/ + RUN \ cd /app/lib/python3.10/site-packages/wyoming_piper/; \ for file in /tmp/wyoming_piper*.diff;do patch -p0 --forward < $file;done; - # cp /build/install/lib*.so* /app/lib/ ########################################## FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 AS dist