forked from rhasspy/piper-phonemize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (32 loc) · 1.69 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# https://github.com/Cantera/cantera-base-manylinux/blob/main/Dockerfile
# Note, TARGET_ARCH must be defined as a build-time arg, it is deliberately different
# from TARGETARCH which is defined by docker. The reason is because TARGETARCH=amd64
# but we need TARGET_ARCH=x86_64
ARG TARGET_ARCH
FROM quay.io/pypa/manylinux_2_28_${TARGET_ARCH:-x86_64} AS build
WORKDIR /piper-phonemize
COPY CMakeLists.txt Makefile MANIFEST.in LICENSE.md README.md ./
COPY src ./src
COPY piper_phonemize ./piper_phonemize
COPY etc ./etc
RUN cmake -B build -D CMAKE_INSTALL_PREFIX=install
RUN cmake --build build --config Release
RUN cmake --install build
# Without this, we'll get: Error processing file '/usr/share/espeak-ng-data/phontab': No such file or directory.
RUN find / -type d -name 'espeak-ng-data' -exec cp -R {} ./piper_phonemize \;
COPY pyproject.toml setup.py ./
RUN /opt/python/cp312-cp312/bin/python -m build --wheel --sdist .
# Fixed up wheels will end up `./wheelhouse` directory.
# Without specifying `LD_LIBRARY_PATH` auditwheel will not be able to find the required libraries.
# NOTE: these libraries were installed in by one of the previous `cmake` commands.
# # Both architectures are included in the `LD_LIBRARY_PATH` to ensure that the library is found in both cases.
# ENV LD_LIBRARY_PATH="./install/lib/:./install/lib64/:./lib/onnxruntime-linux-x64-1.14.1/lib:./lib/onnxruntime-linux-aarch64-1.14.1/lib:${LD_LIBRARY_PATH}"
# RUN auditwheel repair dist/*.whl
# # Smoke test
# RUN echo "testing one two three" | ./install/bin/piper_phonemize -l en-us --espeak-data ./piper_phonemize
#
FROM scratch
CMD [ "/bin/bash" ]
#
# COPY --from=build /piper-phonemize/wheelhouse/ ./
# COPY --from=build /piper-phonemize/dist/*.tar.gz ./