-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
57 lines (43 loc) · 1.14 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
FROM python:3.8.6-slim-buster
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED True
RUN apt-get update -qq \
&& apt-get install -qqy --no-install-recommends \
ffmpeg \
libportaudio2 \
libportaudiocpp0 \
libsndfile1-dev \
portaudio19-dev \
pulseaudio \
python3-pyaudio \
gcc \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
RUN addgroup --gid 1000 ml \
&& adduser --gecos "" \
--home /usr/src/app \
--shell /bin/bash \
--uid 1000 \
--gid 1000 \
--disabled-password \
ml \
&& adduser ml adm \
&& adduser ml audio \
&& adduser ml pulse \
&& adduser ml voice
COPY ./requirements.txt .
RUN pip3 install --no-cache-dir --upgrade pip \
torch==1.6.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html \
pyaudio \
-r requirements.txt
COPY . .
RUN mkdir -p .local/bin .config .cache \
mkdir -p /run/user/1000 \
&& chown ml:ml /run/user/1000
USER ml
ENV PATH="/usr/src/app/.local/bin:$PATH"
COPY --chown=ml:ml . .
RUN chmod +x /usr/src/app/run.sh
EXPOSE 8080
ENTRYPOINT /usr/src/app/run.sh