forked from synesthesiam/docker-mozillatts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (37 loc) · 1.2 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
FROM python:3.6 as build
ENV LANG C.UTF-8
RUN apt-get update && \
apt-get install --yes espeak
RUN mkdir -p /app
RUN cd /app && \
git clone https://github.com/mozilla/TTS && \
cd TTS && \
git checkout c7296b3
# git checkout 6d6dca0
RUN cd /app/TTS && \
python3 -m venv .venv
RUN cd /app/TTS && \
.venv/bin/pip3 install --upgrade pip && \
.venv/bin/pip3 install -r requirements.txt && \
.venv/bin/python3 setup.py install && \
.venv/bin/pip3 install tensorflow==2.3.0rc0
# Extra packages missing from requirements
RUN cd /app/TTS && \
.venv/bin/pip3 install inflect 'numba==0.48'
# Packages needed for web server
RUN cd /app/TTS && \
.venv/bin/pip3 install 'flask' 'flask-cors'
# fix 6d6dca0 manually
RUN sed -i 's/import scipy.io/import scipy.io.wavfile/' /app/TTS/utils/audio.py
# -----------------------------------------------------------------------------
FROM python:3.6-slim
RUN apt-get update && \
apt-get install --yes espeak
COPY --from=build /app /app
COPY vocoder/ /app/vocoder/
COPY model/ /app/model/
COPY templates/ /app/templates/
COPY tts.py scale_stats.npy /app/
WORKDIR /app
EXPOSE 5002
ENTRYPOINT ["/app/TTS/.venv/bin/python3", "/app/tts.py"]