forked from marytts/marytts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
97 lines (67 loc) · 3.01 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
FROM buildpack-deps
############# INITIAL SETUP/INSTALLATION #############
# non-root user
RUN useradd -m -u 8877 wikispeech
# setup apt
RUN apt-get update -y && apt-get upgrade -y && apt-get install apt-utils -y
# debugging tools
# RUN apt-get install -y libnet-ifconfig-wrapper-perl/stable curl wget emacs
# RELEASE variable (to be set by build args)
ARG RELEASE="undefined"
LABEL "se.stts.vendor"="STTS - Speech technology services - http://stts.se"
LABEL "se.stts.release"=$RELEASE
############# COMPONENT SPECIFIC DEPENDENCIES #############
RUN apt-get install -y python software-properties-common
RUN add-apt-repository ppa:openjdk && apt-get install -y openjdk-11-jdk
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
############# MARYTTS #############
ENV BASEDIR /wikispeech/marytts
WORKDIR $BASEDIR
# local copy of https://github.com/stts-se/marytts.git
COPY . $BASEDIR
RUN mkdir -p $BASEDIR/bin
WORKDIR $BASEDIR
RUN ./gradlew installDist --stacktrace
## INSTALL STTS VOICES
RUN cp stts_voices/voice-ar-nah-hsmm-5.2.jar build/install/marytts/lib/
RUN cp stts_voices/voice-dfki-spike-hsmm-5.1.jar build/install/marytts/lib/
RUN cp stts_voices/voice-stts_no_nst-hsmm-5.2.jar build/install/marytts/lib/
RUN cp stts_voices/voice-stts_sv_nst-hsmm-5.2-SNAPSHOT.jar build/install/marytts/lib/
## SCRIPT FOR LISTING VOICES
RUN echo "echo 'AVAILABLE VOICES:' && ls $BASEDIR/build/install/marytts/lib/ | egrep ^voice | sed 's/.jar//' | sed 's/^/* /' " > $BASEDIR/bin/marytts_voices
RUN chmod +x $BASEDIR/bin/marytts_voices
############# MISHKAL #############
WORKDIR "/wikispeech"
# RUN git clone https://github.com/linuxscout/mishkal.git
# NO LONGER NEEDED (FIXED IN HB'S VERSION):
# RUN sed -i.BAK 's/self.display(word, format_display)/self.display(voc_word, format_display)/' mishkal/tashkeel/tashkeel.py
# RELEASE TAG/COMMIT ID/BRANCH NAME FOR MISHKAL | update if needed
ARG MISHKAL_RELEASE=9624fbd
RUN git clone https://github.com/HaraldBerthelsen/mishkal.git
WORKDIR "/wikispeech/mishkal"
RUN git checkout $MISHKAL_RELEASE
############# START SCRIPT #############
RUN echo "python /wikispeech/mishkal/interfaces/web/mishkal-webserver.py &" > $BASEDIR/bin/marytts-mishkal-start
RUN echo "sleep 2" >> $BASEDIR/bin/marytts-mishkal-start
RUN echo "whoami" >> $BASEDIR/bin/marytts-mishkal-start
RUN echo "cd $BASEDIR && ./gradlew run" >> $BASEDIR/bin/marytts-mishkal-start
RUN chmod +x $BASEDIR/bin/marytts-mishkal-start
############# POST INSTALL #############
WORKDIR "/wikispeech"
# BUILD INFO
ENV BUILD_INFO_FILE $BASEDIR/build_info.txt
RUN echo "Application name: marytts" >> $BUILD_INFO_FILE
RUN echo -n "Build timestamp: " >> $BUILD_INFO_FILE
RUN date --utc "+%Y-%m-%d %H:%M:%S %Z" >> $BUILD_INFO_FILE
RUN echo "Built by: docker" >> $BUILD_INFO_FILE
RUN echo "Release: $RELEASE" >> $BUILD_INFO_FILE
RUN cat $BUILD_INFO_FILE
## LIST MARYTTS VOICES
RUN $BASEDIR/bin/marytts_voices
############# RUNTIME SETTINGS #############
WORKDIR $BASEDIR
RUN chown -R wikispeech.wikispeech /wikispeech
USER wikispeech
EXPOSE 59125
CMD $BASEDIR/bin/marytts-mishkal-start