-
Notifications
You must be signed in to change notification settings - Fork 516
/
Copy pathDockerfile
52 lines (42 loc) · 1.54 KB
/
Dockerfile
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
#---
# name: whisper
# group: audio
# depends: [numba, numpy, pytorch, torchaudio, jupyterlab]
# requires: '>=34.1.0'
# docs: docs.md
#---
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
WORKDIR /opt
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ffmpeg \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
RUN pip3 install --no-cache-dir --verbose pandas scipy jiwer ipywebrtc
ADD https://api.github.com/repos/openai/whisper/git/refs/heads/main /tmp/whisper_version.json
# Clone the repository:
RUN git clone https://github.com/openai/whisper/ && \
cd whisper && \
sed 's|^numba.*||' -i requirements.txt && \
sed 's|^numpy.*||' -i requirements.txt && \
sed 's|^torch.*||' -i requirements.txt && \
cat requirements.txt && \
pip3 wheel --wheel-dir=dist --no-deps --verbose .
RUN cp whisper/dist/openai_whisper*.whl /opt && \
pip3 install --no-cache-dir --verbose /opt/openai_whisper*.whl
WORKDIR /opt/whisper/
COPY record-and-transcribe.ipynb /opt/whisper/notebooks
RUN openssl req \
-new \
-newkey rsa:4096 \
-days 365 \
-nodes \
-x509 \
-keyout mykey.key \
-out mycert.pem \
-subj '/CN=localhost'
CMD /bin/bash -c "jupyter lab --ip 0.0.0.0 --port 8888 --certfile=mycert.pem --keyfile mykey.key --allow-root &> /var/log/jupyter.log" & \
echo "allow 10 sec for JupyterLab to start @ https://$(hostname -I | cut -d' ' -f1):8888 (password nvidia)" && \
echo "JupterLab logging location: /var/log/jupyter.log (inside the container)" && \
/bin/bash