-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (23 loc) · 842 Bytes
/
Dockerfile
File metadata and controls
38 lines (23 loc) · 842 Bytes
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
# Stage 1 - Build dependencies from source
FROM python:3.8-slim AS builder
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
RUN apt-get update && \
apt-get install -y build-essential libsndfile1 vim gcc g++ cmake
RUN python3 -m pip install Cython --install-option="--no-cython-compile"
# These are some packages who will take a lot of time to build
RUN python3 -m pip install --upgrade pip numpy numba pyopenjtalk
WORKDIR /build
COPY requirements.txt .
RUN python3 -m pip install -r requirements.txt
# Stage 2 - Runtime image
FROM python:3.8-slim
ENV SERVER_HOST='0.0.0.0' \
SERVER_PORT=9557
EXPOSE $SERVER_PORT
WORKDIR /app
COPY --from=builder /usr/local/ /usr/local/
COPY . .
CMD ["python3", "main.py"]