Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# used to improve stage build time by ignoring these changes in cache
Dockerfile
31 changes: 22 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,45 @@
FROM debian:bullseye as build
FROM debian:latest AS build
ARG TARGETARCH
ARG TARGETVARIANT

ENV LANG C.UTF-8
ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive

# system dependencies
RUN apt-get update && \
apt-get install --yes --no-install-recommends \
build-essential cmake ca-certificates curl pkg-config git
build-essential cmake ca-certificates curl pkg-config git

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# build piper-phonemize
WORKDIR /build

COPY ./ ./
COPY . .
RUN cmake -Bbuild -DCMAKE_INSTALL_PREFIX=install
RUN cmake --build build --config Release
RUN cmake --install build

# Do a test run
# do a test run
RUN ./build/piper_phonemize --help

# Build .tar.gz to keep symlinks
# build .tar.gz to keep symlinks
WORKDIR /dist
RUN mkdir -p piper_phonemize && \
cp -dR /build/install/* ./piper_phonemize/ && \
tar -czf "piper-phonemize_${TARGETARCH}${TARGETVARIANT}.tar.gz" piper_phonemize/

# -----------------------------------------------------------------------------
# build python wheel
ENV CPLUS_INCLUDE_PATH=/build/install/include
ENV LIBRARY_PATH=/build/install/lib

WORKDIR /build
ENV UV_PYTHON=3.13
RUN uv run setup.py sdist bdist_wheel
RUN cp dist/*.whl /dist/

# ---------------------

FROM scratch

COPY --from=build /dist/piper-phonemize_*.tar.gz ./
COPY --from=build /dist/*.tar.gz ./
COPY --from=build /dist/*.whl ./
Loading