File size: 1,138 Bytes
c5ed230
 
 
 
 
 
 
 
d94ccbe
c5ed230
 
35c29ec
c5ed230
35c29ec
 
 
 
 
 
 
 
 
 
c5ed230
35c29ec
c5ed230
d94ccbe
c5ed230
35c29ec
 
 
 
 
 
d94ccbe
35c29ec
c5ed230
 
 
d94ccbe
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
FROM python:3.10.11-slim-bullseye

RUN mkdir -p /app
WORKDIR /app

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install -yq build-essential espeak-ng cmake wget && \
    apt-get clean && \
    apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
    rm -rf /var/lib/apt/lists/* 

# Install jemalloc
RUN wget https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 && \
    tar -xvf jemalloc-5.3.0.tar.bz2 && \
    cd jemalloc-5.3.0 && \
    ./configure && \
    make && \
    make install && \
    cd .. && \
    rm -rf jemalloc-5.3.0* && \
    ldconfig 

ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so

RUN pip install torch --index-url https://download.pytorch.org/whl/cpu --no-cache-dir

COPY requirements.txt /app/
RUN pip install --upgrade pip && \
    pip install pyopenjtalk==0.3.2 -i https://pypi.artrajz.cn/simple --no-cache-dir && \
    pip install gunicorn --no-cache-dir && \
    pip install -r requirements.txt --no-cache-dir&& \
    rm -rf /root/.cache/pip/*

COPY . /app

EXPOSE 23456

CMD ["gunicorn", "-c", "gunicorn_config.py", "app:app"]