File size: 1,268 Bytes
f8e3c2f
0faa266
f8e3c2f
 
 
 
0faa266
f8e3c2f
0faa266
f8e3c2f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
416ecfb
 
 
 
 
 
 
 
3e210b5
f8e3c2f
 
 
 
 
0faa266
 
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
FROM debian:bookworm-slim AS builder

RUN apt-get update && \
    apt-get install -y curl git python3 python3-pip python3-venv && \
    rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
    mkdir -p /Whisper-WebUI

WORKDIR /Whisper-WebUI

COPY requirements.txt .

RUN python3 -m venv venv && \
    . venv/bin/activate && \
    pip install --no-cache-dir -r requirements.txt


FROM debian:bookworm-slim AS runtime

RUN apt-get update && \
    apt-get install -y curl ffmpeg python3 && \
    rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

WORKDIR /Whisper-WebUI

COPY . .
COPY --from=builder /Whisper-WebUI/venv /Whisper-WebUI/venv

# Create the necessary directories and set permissions
RUN mkdir -p /Whisper-WebUI/models /Whisper-WebUI/outputs && \
    chown -R 1000:1000 /Whisper-WebUI/models /Whisper-WebUI/outputs

# Use a non-root user
RUN useradd -m user && \
    chown -R user:user /Whisper-WebUI
USER user

VOLUME [ "/Whisper-WebUI/models" ]
VOLUME [ "/Whisper-WebUI/outputs" ]

ENV PATH="/Whisper-WebUI/venv/bin:$PATH"
ENV LD_LIBRARY_PATH=/Whisper-WebUI/venv/lib64/python3.11/site-packages/nvidia/cublas/lib:/Whisper-WebUI/venv/lib64/python3.11/site-packages/nvidia/cudnn/lib

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]