From 05a932606eb851e495a644423035464463be3eb1 Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Thu, 14 May 2026 10:03:48 -0700 Subject: [PATCH 1/2] RE1-T119 Bug fix --- Web/Resgrid.Web.Tts/Dockerfile | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Web/Resgrid.Web.Tts/Dockerfile b/Web/Resgrid.Web.Tts/Dockerfile index 3de54cc9..0b861106 100644 --- a/Web/Resgrid.Web.Tts/Dockerfile +++ b/Web/Resgrid.Web.Tts/Dockerfile @@ -20,9 +20,7 @@ COPY . . WORKDIR /src/Web/Resgrid.Web.Tts RUN dotnet publish "Resgrid.Web.Tts.csproj" -c Release -o /app/publish /p:UseAppHost=false --no-restore -p:Version=${BUILD_VERSION} -FROM base AS final -# Install ffmpeg, download Piper TTS binary and the default English (US) voice -# model, then clean up in a single RUN layer to keep the image small. +FROM build AS publish ARG PIPER_VERSION=v1.2.0 RUN apt-get update \ && apt-get install -y --no-install-recommends \ @@ -30,8 +28,6 @@ RUN apt-get update \ libespeak-ng1 \ ca-certificates \ curl \ - libc-bin \ - passwd \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /usr/local/share/piper-voices \ && curl -fsSL --retry 3 --retry-delay 5 "https://github.com/rhasspy/piper/releases/download/${PIPER_VERSION}/piper_amd64.tar.gz" -o /tmp/piper.tar.gz \ @@ -58,11 +54,28 @@ RUN apt-get update \ curl -fsSL --retry 3 --retry-delay 5 "https://huggingface.co/rhasspy/piper-voices/resolve/main/${f}.onnx.json" -o "/usr/local/share/piper-voices/${name}.onnx.json"; \ done \ && groupadd --gid 10001 appgroup \ - && useradd --uid 10001 --gid appgroup --create-home --shell /usr/sbin/nologin appuser + && useradd --uid 10001 --gid appgroup --create-home --shell /usr/sbin/nologin appuser \ + && mkdir -p /tmp/ttsdeps \ + && for bin in /usr/local/bin/piper /usr/bin/ffmpeg; do \ + ldd "$bin" 2>/dev/null | awk '/=>/ {print $3}' >> /tmp/ttsdeps/libs.txt; \ + done \ + && find /usr/local/lib -name '*.so*' -type f >> /tmp/ttsdeps/libs.txt \ + && sort -u /tmp/ttsdeps/libs.txt | while read lib; do [ -f "$lib" ] && cp "$lib" /tmp/ttsdeps/; done +FROM base AS final WORKDIR /app -COPY --from=build /app/publish . +COPY --from=publish /usr/local/bin/piper /usr/local/bin/piper +COPY --from=publish /usr/local/share/piper-voices/ /usr/local/share/piper-voices/ +COPY --from=publish /usr/share/espeak-ng-data/ /usr/share/espeak-ng-data/ +COPY --from=publish /usr/bin/ffmpeg /usr/bin/ffmpeg +COPY --from=publish /usr/bin/ffprobe /usr/bin/ffprobe +COPY --from=publish /tmp/ttsdeps/ /usr/local/lib/tts/ +COPY --from=publish /etc/passwd /etc/passwd +COPY --from=publish /etc/group /etc/group +COPY --from=publish /app/publish . + +ENV LD_LIBRARY_PATH="/usr/local/lib/tts:${LD_LIBRARY_PATH}" ENV ASPNETCORE_URLS=http://+:8080 USER appuser ENTRYPOINT ["dotnet", "Resgrid.Web.Tts.dll"] From 1f9e9087fccd3ba3f4eb8cde4a46055462d3e8ee Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Thu, 14 May 2026 11:58:04 -0700 Subject: [PATCH 2/2] RE1-T119 Build fix --- Web/Resgrid.Web.Tts/Dockerfile | 12 +++++++++--- Workers/Resgrid.Workers.Console/Dockerfile | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Web/Resgrid.Web.Tts/Dockerfile b/Web/Resgrid.Web.Tts/Dockerfile index 0b861106..66f15c12 100644 --- a/Web/Resgrid.Web.Tts/Dockerfile +++ b/Web/Resgrid.Web.Tts/Dockerfile @@ -22,6 +22,8 @@ RUN dotnet publish "Resgrid.Web.Tts.csproj" -c Release -o /app/publish /p:UseApp FROM build AS publish ARG PIPER_VERSION=v1.2.0 +COPY --from=base /etc/passwd /tmp/base-passwd +COPY --from=base /etc/group /tmp/base-group RUN apt-get update \ && apt-get install -y --no-install-recommends \ ffmpeg \ @@ -55,6 +57,10 @@ RUN apt-get update \ done \ && groupadd --gid 10001 appgroup \ && useradd --uid 10001 --gid appgroup --create-home --shell /usr/sbin/nologin appuser \ + && cp /tmp/base-passwd /tmp/app-passwd \ + && cp /tmp/base-group /tmp/app-group \ + && grep appuser /etc/passwd >> /tmp/app-passwd \ + && grep appgroup /etc/group >> /tmp/app-group \ && mkdir -p /tmp/ttsdeps \ && for bin in /usr/local/bin/piper /usr/bin/ffmpeg; do \ ldd "$bin" 2>/dev/null | awk '/=>/ {print $3}' >> /tmp/ttsdeps/libs.txt; \ @@ -71,11 +77,11 @@ COPY --from=publish /usr/share/espeak-ng-data/ /usr/share/espeak-ng-data/ COPY --from=publish /usr/bin/ffmpeg /usr/bin/ffmpeg COPY --from=publish /usr/bin/ffprobe /usr/bin/ffprobe COPY --from=publish /tmp/ttsdeps/ /usr/local/lib/tts/ -COPY --from=publish /etc/passwd /etc/passwd -COPY --from=publish /etc/group /etc/group +COPY --from=publish /tmp/app-passwd /etc/passwd +COPY --from=publish /tmp/app-group /etc/group COPY --from=publish /app/publish . -ENV LD_LIBRARY_PATH="/usr/local/lib/tts:${LD_LIBRARY_PATH}" +ENV LD_LIBRARY_PATH="/usr/local/lib/tts" ENV ASPNETCORE_URLS=http://+:8080 USER appuser ENTRYPOINT ["dotnet", "Resgrid.Web.Tts.dll"] diff --git a/Workers/Resgrid.Workers.Console/Dockerfile b/Workers/Resgrid.Workers.Console/Dockerfile index 1f0d5d15..7effb704 100644 --- a/Workers/Resgrid.Workers.Console/Dockerfile +++ b/Workers/Resgrid.Workers.Console/Dockerfile @@ -72,7 +72,7 @@ COPY --from=publish /tmp/wkdeps/ /usr/local/lib/wkhtmltopdf/ COPY --from=publish /etc/fonts/ /etc/fonts/ COPY --from=publish /usr/share/fonts/ /usr/share/fonts/ -ENV LD_LIBRARY_PATH="/usr/local/lib/wkhtmltopdf:${LD_LIBRARY_PATH}" +ENV LD_LIBRARY_PATH="/usr/local/lib/wkhtmltopdf" COPY --from=publish /app/publish .