-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.cpu
75 lines (58 loc) · 2.03 KB
/
Dockerfile.cpu
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
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND="noninteractive" \
PORT=8080
ARG INSTALL="apt-get install -y --no-install-recommends"
ARG PIP="python -m pip install --upgrade --no-cache-dir --retries 10 --timeout 60"
RUN set -x \
&& apt-get update \
&& $INSTALL wget \
curl \
git \
&& apt-get -y autoremove \
&& apt-get clean
# && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN $INSTALL \
software-properties-common \
&& \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
$INSTALL \
python3.7 \
python3.7-dev \
python3-distutils-extra \
&& \
wget -O ~/get-pip.py \
https://bootstrap.pypa.io/get-pip.py && \
python3.7 ~/get-pip.py && \
ln -s /usr/bin/python3.7 /usr/local/bin/python3 && \
ln -s /usr/bin/python3.7 /usr/local/bin/python && \
$PIP setuptools
COPY ./requirements-server.txt /app/requirements.txt
RUN $PIP -r /app/requirements.txt \
uvicorn==0.11.8 \
gunicorn==20.0.4 \
starlette==0.13.8 \
pyyaml==5.4.1 \
redis==3.5.3 \
passlib[bcrypt]==1.7.4 \
PyJWT==2.0.1 \
pydantic==1.8.1
EXPOSE 8080
RUN mkdir /app/models
WORKDIR /app/models
RUN wget -q https://www.softcatala.org/pub/softcatala/catotron-models/upc_ona_tacotron2.pt
RUN wget -q https://www.softcatala.org/pub/softcatala/catotron-models/upc_pau_tacotron2.pt
RUN wget -q https://www.softcatala.org/pub/softcatala/catotron-models/melgan_onapau_catotron.pt
RUN mkdir /app/models/mel
WORKDIR /app/models/mel
RUN git clone --depth 10 https://github.com/descriptinc/melgan-neurips
RUN mv melgan-neurips descriptinc_melgan-neurips_master
WORKDIR /app
COPY . .
RUN chmod +x /app/start.sh
ENV WEB_CONCURRENCY=1 \
TOKEN_EXPIRE_MINUTES=10 \
AUTH_ALGORITHM=HS256 \
SECRET_KEY=4692454ea5f3e570ecb96f161e53c94f0590bd4f53ece505ed941b834e5d5147
HEALTHCHECK --start-period=15s --interval=5s --timeout=3s --retries=3 CMD curl -f / http://localhost:8080/test || exit 1
CMD ["/app/start.sh"]