Update Dockerfile
Browse files- Dockerfile +31 -1
Dockerfile
CHANGED
@@ -4,15 +4,42 @@ FROM python:3.8-slim
|
|
4 |
# 设置环境变量,防止生成 pyc 文件
|
5 |
ENV PYTHONUNBUFFERED=1
|
6 |
|
7 |
-
#
|
8 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
9 |
build-essential \
|
10 |
wget \
|
11 |
git \
|
12 |
libsndfile1 \
|
13 |
cmake \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
&& rm -rf /var/lib/apt/lists/*
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
# 创建工作目录
|
17 |
WORKDIR /app
|
18 |
|
@@ -35,6 +62,9 @@ RUN pip install --no-cache-dir \
|
|
35 |
jieba \
|
36 |
Cython
|
37 |
|
|
|
|
|
|
|
38 |
# 下载模型文件
|
39 |
RUN mkdir -p /app/ys && \
|
40 |
wget -c "https://github.com/LemonFan-maker/Download-Models/releases/download/ys/ys.pth" -P /app/ys
|
|
|
4 |
# 设置环境变量,防止生成 pyc 文件
|
5 |
ENV PYTHONUNBUFFERED=1
|
6 |
|
7 |
+
# 安装必要的系统依赖和 OpenJTalk、MeCab
|
8 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
9 |
build-essential \
|
10 |
wget \
|
11 |
git \
|
12 |
libsndfile1 \
|
13 |
cmake \
|
14 |
+
libatlas-base-dev \
|
15 |
+
libtool \
|
16 |
+
automake \
|
17 |
+
autoconf \
|
18 |
+
sox \
|
19 |
+
ffmpeg \
|
20 |
+
# 安装 MeCab 及其开发库
|
21 |
+
mecab \
|
22 |
+
libmecab-dev \
|
23 |
+
mecab-ipadic-utf8 \
|
24 |
+
# 安装其他依赖
|
25 |
+
zlib1g-dev \
|
26 |
&& rm -rf /var/lib/apt/lists/*
|
27 |
|
28 |
+
# 安装 OpenJTalk
|
29 |
+
RUN mkdir -p /tmp/open_jtalk && \
|
30 |
+
cd /tmp/open_jtalk && \
|
31 |
+
wget -O open_jtalk.tar.gz "https://sourceforge.net/projects/open-jtalk/files/Open%20JTalk/open_jtalk-1.11/open_jtalk-1.11.tar.gz/download" && \
|
32 |
+
tar xzf open_jtalk.tar.gz && \
|
33 |
+
cd open_jtalk-1.11 && \
|
34 |
+
./configure --with-charset=utf8 && \
|
35 |
+
make && \
|
36 |
+
make install && \
|
37 |
+
ldconfig
|
38 |
+
|
39 |
+
# 设置环境变量
|
40 |
+
ENV LD_LIBRARY_PATH=/usr/local/lib
|
41 |
+
ENV PATH="/usr/local/bin:${PATH}"
|
42 |
+
|
43 |
# 创建工作目录
|
44 |
WORKDIR /app
|
45 |
|
|
|
62 |
jieba \
|
63 |
Cython
|
64 |
|
65 |
+
# 安装 pyopenjtalk
|
66 |
+
RUN pip install --no-cache-dir pyopenjtalk
|
67 |
+
|
68 |
# 下载模型文件
|
69 |
RUN mkdir -p /app/ys && \
|
70 |
wget -c "https://github.com/LemonFan-maker/Download-Models/releases/download/ys/ys.pth" -P /app/ys
|