-
Notifications
You must be signed in to change notification settings - Fork 62
/
Dockerfile
66 lines (50 loc) · 1.89 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM debian:buster as build
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
RUN --mount=type=cache,id=apt-build,target=/var/apt/cache \
apt-get update && \
apt-get install --no-install-recommends --yes \
python3 python3-dev python3-setuptools python3-pip python3-venv \
build-essential swig libatlas-base-dev portaudio19-dev \
curl ca-certificates
ENV APP_DIR=/usr/lib/voice2json
ENV BUILD_DIR=/build
# Directory of prebuilt tools
ARG TARGETARCH
ARG TARGETVARIANT
COPY download/shared ${BUILD_DIR}/download/
COPY download/${TARGETARCH}${TARGETVARIANT}/ ${BUILD_DIR}/download/
COPY m4/ ${BUILD_DIR}/m4/
COPY configure config.sub config.guess \
install-sh missing aclocal.m4 \
Makefile.in setup.py.in voice2json.sh.in voice2json.spec.in \
requirements.txt \
${BUILD_DIR}/
RUN cd ${BUILD_DIR} && \
./configure --enable-in-place --prefix=${APP_DIR}/.venv
COPY scripts/install/ ${BUILD_DIR}/scripts/install/
RUN --mount=type=cache,id=pip-build,target=/root/.cache/pip \
cd ${BUILD_DIR} && \
make && \
make install
# -----------------------------------------------------------------------------
FROM debian:buster as run
ENV LANG C.UTF-8
RUN --mount=type=cache,id=apt-run,target=/var/apt/cache \
apt-get update && \
apt-get install --yes --no-install-recommends \
python3 \
libportaudio2 libatlas3-base libgfortran4 \
ca-certificates \
perl sox alsa-utils espeak-ng jq
ENV APP_DIR=/usr/lib/voice2json
COPY --from=build ${APP_DIR}/ ${APP_DIR}/
COPY --from=build /build/voice2json.sh ${APP_DIR}/
COPY etc/profile.defaults.yml ${APP_DIR}/etc/
COPY etc/profiles/ ${APP_DIR}/etc/profiles/
COPY etc/precise/ ${APP_DIR}/etc/precise/
COPY site/ ${APP_DIR}/site/
COPY bin/voice2json ${APP_DIR}/bin/
COPY VERSION ${APP_DIR}/
COPY voice2json/ ${APP_DIR}/voice2json/
ENTRYPOINT ["bash", "/usr/lib/voice2json/voice2json.sh"]