|
2 | 2 | # |
3 | 3 | # SPDX-License-Identifier: MPL-2.0 |
4 | 4 |
|
5 | | -# Demo image: CPU-only with Helsinki translation, all core plugins, and sample pipelines |
| 5 | +# Demo image: CPU-only with all core plugins (including Pocket TTS and Supertonic) and sample pipelines |
6 | 6 | # syntax=docker/dockerfile:1 |
7 | 7 |
|
8 | 8 | # Version configuration |
@@ -441,6 +441,86 @@ RUN PIP_BREAK_SYSTEM_PACKAGES=1 pip3 install --no-cache-dir \ |
441 | 441 | tokenizers && \ |
442 | 442 | python3 plugins/native/helsinki/download-models.py |
443 | 443 |
|
| 444 | +# Stage 11: Build Pocket TTS plugin |
| 445 | +FROM rust:1.92-slim-bookworm AS pocket-tts-builder |
| 446 | + |
| 447 | +WORKDIR /build |
| 448 | + |
| 449 | +# Install build dependencies |
| 450 | +RUN apt-get update && apt-get install -y \ |
| 451 | + pkg-config \ |
| 452 | + libssl-dev \ |
| 453 | + g++ \ |
| 454 | + cmake \ |
| 455 | + curl \ |
| 456 | + libclang-dev \ |
| 457 | + clang \ |
| 458 | + git \ |
| 459 | + && rm -rf /var/lib/apt/lists/* |
| 460 | + |
| 461 | +# Copy only what's needed to build pocket-tts plugin |
| 462 | +COPY Cargo.toml Cargo.lock ./ |
| 463 | +COPY crates/core ./crates/core |
| 464 | +COPY sdks/plugin-sdk ./sdks/plugin-sdk |
| 465 | +COPY plugins/native/pocket-tts ./plugins/native/pocket-tts |
| 466 | + |
| 467 | +# Build pocket-tts plugin |
| 468 | +RUN --mount=type=cache,id=cargo-registry-pocket-tts,target=/usr/local/cargo/registry \ |
| 469 | + --mount=type=cache,id=cargo-git-pocket-tts,target=/usr/local/cargo/git \ |
| 470 | + --mount=type=cache,id=pocket-tts-target,target=/build/plugins/native/pocket-tts/target \ |
| 471 | + cd plugins/native/pocket-tts && \ |
| 472 | + cargo build --release --target-dir target && \ |
| 473 | + mkdir -p /build/plugins/native && \ |
| 474 | + cp target/release/libpocket_tts.so /build/plugins/native/ |
| 475 | + |
| 476 | +# Download Pocket TTS models |
| 477 | +RUN mkdir -p /build/models && \ |
| 478 | + cd /build/models && \ |
| 479 | + curl -L -o pocket-tts-b6369a24.tar.bz2 \ |
| 480 | + https://huggingface.co/streamkit/pocket-tts-models/resolve/main/pocket-tts-b6369a24.tar.bz2 && \ |
| 481 | + tar xf pocket-tts-b6369a24.tar.bz2 && \ |
| 482 | + rm pocket-tts-b6369a24.tar.bz2 |
| 483 | + |
| 484 | +# Stage 12: Build Supertonic TTS plugin |
| 485 | +FROM rust:1.92-slim-bookworm AS supertonic-builder |
| 486 | + |
| 487 | +WORKDIR /build |
| 488 | + |
| 489 | +# Install build dependencies |
| 490 | +RUN apt-get update && apt-get install -y \ |
| 491 | + pkg-config \ |
| 492 | + libssl-dev \ |
| 493 | + g++ \ |
| 494 | + cmake \ |
| 495 | + curl \ |
| 496 | + libclang-dev \ |
| 497 | + clang \ |
| 498 | + git \ |
| 499 | + && rm -rf /var/lib/apt/lists/* |
| 500 | + |
| 501 | +# Copy only what's needed to build supertonic plugin |
| 502 | +COPY Cargo.toml Cargo.lock ./ |
| 503 | +COPY crates/core ./crates/core |
| 504 | +COPY sdks/plugin-sdk ./sdks/plugin-sdk |
| 505 | +COPY plugins/native/supertonic ./plugins/native/supertonic |
| 506 | + |
| 507 | +# Build supertonic plugin |
| 508 | +RUN --mount=type=cache,id=cargo-registry-supertonic,target=/usr/local/cargo/registry \ |
| 509 | + --mount=type=cache,id=cargo-git-supertonic,target=/usr/local/cargo/git \ |
| 510 | + --mount=type=cache,id=supertonic-target,target=/build/plugins/native/supertonic/target \ |
| 511 | + cd plugins/native/supertonic && \ |
| 512 | + cargo build --release --target-dir target && \ |
| 513 | + mkdir -p /build/plugins/native && \ |
| 514 | + cp target/release/libsupertonic.so /build/plugins/native/ |
| 515 | + |
| 516 | +# Download Supertonic models |
| 517 | +RUN mkdir -p /build/models && \ |
| 518 | + cd /build/models && \ |
| 519 | + curl -L -o supertonic-v2-onnx.tar.bz2 \ |
| 520 | + https://huggingface.co/streamkit/supertonic-models/resolve/main/supertonic-v2-onnx.tar.bz2 && \ |
| 521 | + tar xf supertonic-v2-onnx.tar.bz2 && \ |
| 522 | + rm supertonic-v2-onnx.tar.bz2 |
| 523 | + |
444 | 524 | # Runtime stage |
445 | 525 | FROM debian:bookworm-slim |
446 | 526 |
|
@@ -494,6 +574,14 @@ COPY --from=vad-builder /build/models/ten-vad.onnx /opt/streamkit/models/ten-vad |
494 | 574 | COPY --from=matcha-builder /build/plugins/native/* /opt/streamkit/plugins/native/ |
495 | 575 | COPY --from=matcha-builder /build/models/matcha-icefall-en_US-ljspeech /opt/streamkit/models/matcha-icefall-en_US-ljspeech |
496 | 576 |
|
| 577 | +# Copy pocket-tts plugin and models |
| 578 | +COPY --from=pocket-tts-builder /build/plugins/native/* /opt/streamkit/plugins/native/ |
| 579 | +COPY --from=pocket-tts-builder /build/models/pocket-tts /opt/streamkit/models/pocket-tts |
| 580 | + |
| 581 | +# Copy supertonic plugin and models |
| 582 | +COPY --from=supertonic-builder /build/plugins/native/* /opt/streamkit/plugins/native/ |
| 583 | +COPY --from=supertonic-builder /build/models/supertonic-v2-onnx /opt/streamkit/models/supertonic-v2-onnx |
| 584 | + |
497 | 585 | # Copy sample pipelines + small bundled audio samples (Opus/Ogg only) |
498 | 586 | COPY --chown=app:app samples/pipelines /opt/streamkit/samples/pipelines |
499 | 587 | COPY --chown=app:app samples/audio/system/*.ogg samples/audio/system/*.ogg.license /opt/streamkit/samples/audio/system/ |
|
0 commit comments