-
Notifications
You must be signed in to change notification settings - Fork 12
/
dockerfile.cuda
47 lines (36 loc) · 1.12 KB
/
dockerfile.cuda
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
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 as builder
RUN apt-get update && apt-get install -y \
curl \
pkg-config \
libssl-dev \
protobuf-compiler \
cmake \
ffmpeg \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
WORKDIR /app
COPY . .
ARG FEATURES=cuda
RUN cargo build --release --features ${FEATURES}
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN mkdir -p /app/models /app/asr_data/audio /app/asr_data/database
COPY --from=builder /app/target/release/asr-rs /app/asr-rs
COPY --from=builder /app/script/download-ggml-model.sh /app/script/
ENV ASR_SQLITE_PATH=sqlite:///app/asr_data/database/storage.db?mode=rwc
ENV ASR_AUDIO_PATH=/app/asr_data/audio
ENV ASR_MODEL_PATH=/app/models/ggml-large-v3.bin
ENV RUST_LOG=info
EXPOSE 7200
EXPOSE 7300
CMD if [ ! -f ${ASR_MODEL_PATH} ]; then \
./script/download-ggml-model.sh; \
fi && \
./asr-rs