-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
138 lines (87 loc) · 4.24 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
FROM debian:bullseye-slim
MAINTAINER Daniel Sobe <[email protected]>
# docker build -t web_demo_spoznawanje .
# docker build -t web_demo_spoznawanje . --no-cache
RUN apt update
###################################
# Setup locale
###################################
RUN apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
###################################
# Web server
###################################
RUN apt install -y apache2 php
RUN a2enmod ssl
RUN a2ensite default-ssl
RUN apt install -y ffmpeg
###################################
# Build WebRTC dependency
###################################
# was it really clang that was acting strange?
# RUN apt install -y clang make git
RUN apt install -y g++ make git
RUN git clone https://github.com/ZalozbaDev/webrtc-audio-processing.git webrtc-audio-processing
RUN apt install -y meson libabsl-dev
RUN cd webrtc-audio-processing && meson . build -Dprefix=$PWD/install && ninja -C build
###################################
# Build Respeaker USB VAD dependency
###################################
RUN git clone https://github.com/ZalozbaDev/usb_4_mic_array.git usb_4_mic_array
RUN apt install -y libusb-1.0-0 libusb-1.0-0-dev
RUN cd usb_4_mic_array/cpp/ && chmod 755 build_static.sh && ./build_static.sh
###################################
# Recognition software incl grammar compilation / repackaging
###################################
# make it work with a recent development version of dlabpro & recognizer
RUN git clone https://github.com/ZalozbaDev/dLabPro.git dLabPro
RUN cd dLabPro && git checkout 48d94ed0e4b2424922c28aaf81e05d1066883b01
RUN apt install -y libreadline-dev portaudio19-dev
RUN cd dLabPro && make -C programs/dlabpro RELEASE && make -C programs/recognizer RELEASE
# use a fixed version of UASR
RUN git clone https://github.com/ZalozbaDev/UASR.git UASR
RUN cd UASR && git checkout 8ff6eb727dc303fff4c5556574caa0dae204a3e6
RUN mkdir /dLabPro/bin.release/uasr-data
COPY uasr-data /dLabPro/bin.release/uasr-data
# add the tool for rendering grammar and lexicon into a .svg
RUN apt install -y graphviz
# the acoustic model(s) are taken from a repo, because we are not modifying them here (just repackaging)
RUN git clone https://github.com/ZalozbaDev/speech_recognition_pretrained_models.git speech_recognition_pretrained_models
RUN mkdir /dLabPro/bin.release/uasr-data/db-hsb-asr-exp/common/model/ && \
cp /speech_recognition_pretrained_models/2022_02_21/*.hmm /dLabPro/bin.release/uasr-data/db-hsb-asr-exp/common/model/ && \
cp /speech_recognition_pretrained_models/2022_02_21/*.object /dLabPro/bin.release/uasr-data/db-hsb-asr-exp/common/model/
COPY run_generation.sh /dLabPro/bin.release/
RUN cd /dLabPro/bin.release/ && ./run_generation.sh
RUN mkdir -p /var/www/html/smartlamp && cp /dLabPro/bin.release/recognizer /var/www/html/smartlamp
COPY smartlamp/recognizer.* /var/www/html/smartlamp/
RUN cp -r /dLabPro/bin.release/log /var/www/html/smartlamp/
###################################
# Pages
###################################
RUN apt install -y curl
COPY www /var/www/html/mudralampa
RUN curl https://code.jquery.com/jquery-3.5.1.min.js > /var/www/html/mudralampa/js/jquery-3.5.1.min.js
RUN curl https://code.jquery.com/color/jquery.color-2.1.2.min.js > /var/www/html/mudralampa/js/jquery.color-2.1.2.min.js
RUN git clone https://github.com/blueimp/JavaScript-MD5
RUN cp JavaScript-MD5/js/md5.min.js /var/www/html/mudralampa/js/
RUN rm -rf JavaScript-MD5
RUN mkdir /var/www/html/audio
RUN sed -i "s/DocumentRoot.*html/DocumentRoot\ \/var\/www\/html\/mudralampa\//" /etc/apache2/sites-available/000-default.conf
RUN sed -i "s/DocumentRoot.*html/DocumentRoot\ \/var\/www\/html\/mudralampa\//" /etc/apache2/sites-available/default-ssl.conf
RUN chown -R www-data:www-data /var/www/html/
###################################
# Container config
###################################
# nice to have
RUN apt install -y nano
# remove stuff only required for building container
# RUN apt remove -y --purge g++ make git curl
# RUN apt autoremove -y --purge
RUN apt-get clean
# expose both but only HTTPS will actually be functional
EXPOSE 80 443
CMD apachectl -D FOREGROUND