forked from mgarmash/rhvoice-rest
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.amd64
41 lines (35 loc) · 1.82 KB
/
Dockerfile.amd64
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
# docker build -t aculeasis/rhvoice-rest:amd64 -f Dockerfile.amd64 .
FROM amd64/ubuntu:20.04
LABEL org.opencontainers.image.source https://github.com/Aculeasis/rhvoice-rest
ARG RUNTIME_PACKAGES="lame python3 locales opus-tools flac python3-setuptools"
ARG BUILD_PACKAGES="git python3-pip python3-wheel wget ca-certificates"
COPY requirements.txt /tmp/requirements.txt
RUN apt-get update -y && \
apt-get -y install --no-install-recommends $RUNTIME_PACKAGES && \
apt-mark manual $(apt-mark showauto) && \
apt-get -y install --no-install-recommends $BUILD_PACKAGES && \
cd /usr/share/locale/ && ls | grep -v 'ru\|en\|locale.alias' | xargs rm -rf && \
locale-gen ru_RU.UTF-8 && \
pip3 install -r /tmp/requirements.txt && \
wget -q https://raw.githubusercontent.com/Aculeasis/ff/main/rhv_bin.py -O rhv_bin.py && \
pip3 install $(python3 rhv_bin.py 0 0 data) && \
pip3 install $(python3 rhv_bin.py linux amd64) && \
git clone https://github.com/vantu5z/RHVoice-dictionary.git /opt/RHVoice-dictionary && \
mkdir -p /usr/local/etc/RHVoice/ && \
cp -R /opt/RHVoice-dictionary/dicts /usr/local/etc/RHVoice/dicts && \
cp -R /opt/RHVoice-dictionary/tools/preprocessing /opt/rhvoice_tools && \
cd /opt && mkdir /opt/cfg && \
apt-get remove --purge -y $BUILD_PACKAGES $(apt-mark showauto) && \
apt-get autoremove -y && \
apt-get -y install --no-install-recommends $RUNTIME_PACKAGES && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp /usr/share/doc/* /usr/share/info/* \
/usr/lib/python*/test /root/.cache/* /opt/RHVoice-dictionary
ENV LC_ALL ru_RU.UTF-8
ENV LANG ru_RU.UTF-8
ENV LANGUAGE ru_RU.UTF-8
COPY entrypoint.sh /opt/entrypoint.sh
COPY rhvoice_rest_cache.py /opt/rhvoice_rest_cache.py
COPY app.py /opt/app.py
EXPOSE 8080/tcp
ENTRYPOINT ["/bin/bash", "/opt/entrypoint.sh"]