-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
114 lines (111 loc) · 3.77 KB
/
Dockerfile
File metadata and controls
114 lines (111 loc) · 3.77 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Builder
FROM ubuntu:22.04 AS builder
# Dependencies-Builder
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]
# Workspace
RUN apt-get update && \
apt-get install -y \
curl\
wget \
git \
cmake \
build-essential \
python3-pip \
make \
g++ \
libcurl4 \
libcurl4-openssl-dev \
aria2 \
ffmpeg \
libopencv-dev \
libboost-all-dev \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
find / -name "*.pyc" -delete 2>/dev/null || true
# Git && Make
WORKDIR /app
RUN git clone -b asr_update https://github.com/wjwever/duix.ai.core.git . && \
if [ ! -d build ]; then mkdir build && cd build; else cd build; fi && \
cmake /app && \
make -j$(nproc)
# Running Phase
FROM ubuntu:22.04
# copy from builder
COPY --from=builder /app /app
VOLUME /root/.cache/uv
ENV DEBIAN_FRONTEND=noninteractive
ENV MINIMAX_API_KEY=${MINIMAX_API_KEY} \
LM_API_KEY=${LM_API_KEY}
ENV PATH="/root/.local/bin:${PATH}"
ENV PATH="/app/.venv/bin:/root/.local/bin:${PATH}"
SHELL ["/bin/bash", "-c"]
# Running Dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ffmpeg \
portaudio19-dev \
supervisor \
python3 \
libportaudio2 \
libasound2-dev \
libopencv-dev \
libcurl4 \
libcurl4-openssl-dev \
curl \
wget \
unzip \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
find / -name "*.pyc" -delete 2>/dev/null || true
# catalog & Initialization
RUN mkdir -p /var/log/supervisor /app/build/roles /app/build/audio /app/build/video
# config supervisor
COPY supervisord.conf /etc/supervisor/supervisord.conf
# Download resources & models
WORKDIR /app/build
RUN if [ ! -d "gj_dh_res" ]; then \
wget -q --no-check-certificate https://cdn.guiji.ai/duix/location/gj_dh_res.zip -O gj_dh_res.zip \
&& unzip -q gj_dh_res.zip \
&& rm gj_dh_res.zip; \
fi && \
if [ ! -d "roles/SiYao" ]; then \
wget -q --no-check-certificate https://digital-public.obs.cn-east-3.myhuaweicloud.com/duix/digital/model/1719194450521/siyao_20240418.zip -O siyao_20240418.zip \
&& unzip -q siyao_20240418.zip \
&& mv siyao_20240418 "roles/SiYao" \
&& rm siyao_20240418.zip; \
fi && \
if [ ! -d "roles/DearSister" ]; then \
wget -q --no-check-certificate https://digital-public.obs.cn-east-3.myhuaweicloud.com/duix/digital/model/1719194007931/bendi1_0329.zip -O bendi1_0329.zip \
&& unzip -q bendi1_0329.zip \
&& mv bendi1_0329 "roles/DearSister" \
&& rm bendi1_0329.zip; \
fi && \
if [ ! -f silero_vad.onnx ]; then \
wget -q https://github-1324907443.cos.ap-shanghai.myqcloud.com/silero_vad.onnx -O silero_vad.onnx; \
fi && \
if [ ! -d sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17 ];then \
wget -q https://github-1324907443.cos.ap-shanghai.myqcloud.com/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.gz -O sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.gz \
&& tar zxvf sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.gz \
&& rm sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.gz; \
fi
# UV env
# WORKDIR /app/audio
# # Python Dependencies
# COPY requirements.txt /app/audio/requirements.txt
# RUN apt-get update && apt-get install aria2 -y
# RUN curl -LsS https://astral.sh/uv/install.sh | sh \
# && uv version \
# && uv init . && uv venv \
# && uv add -r /app/audio/requirements.txt \
# && mkdir -p models \
# && export HF_ENDPOINT=https://hf-mirror.com \
# && bash hfd.sh FunAudioLLM/SenseVoiceSmall \
# && mkdir -p /root/.cache && chmod 777 /root/.cache
# # envs
# ENV PATH="/app/audio/.venv/bin:$PATH"
# Socks
RUN rm -f /var/run/supervisor.sock
# Port
EXPOSE 8080 6001-6003
# Go!
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]