WhisperLive-Server/Dockerfile

45 lines
1.9 KiB
Docker

FROM python:3.10-bookworm
ARG DEBIAN_FRONTEND=noninteractive
# Create log directories with proper permissions
RUN mkdir -p /app/logs && \
touch /app/logs/whisperlive.log && \
touch /app/logs/connections.log && \
chmod 666 /app/logs/whisperlive.log && \
chmod 666 /app/logs/connections.log
# install lib required for pyaudio
RUN apt update && apt install -y portaudio19-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
# update pip to support for whl.metadata -> less downloading
RUN pip install --no-cache-dir -U "pip>=24"
# create a working directory
WORKDIR /app
# install the requirements for running the whisper-live server
COPY requirements/server.txt /app/
RUN pip install --no-cache-dir "setuptools<70.0.0" wheel
RUN pip install -r server.txt
RUN pip install --no-build-isolation openai-whisper==20240930
RUN rm server.txt
# make the paths of the nvidia libs installed as wheels visible
RUN pip install --no-cache-dir nvidia-cublas-cu12 nvidia-cudnn-cu12
ENV LD_LIBRARY_PATH="/usr/local/lib/python3.10/site-packages/nvidia/cublas/lib:/usr/local/lib/python3.10/site-packages/nvidia/cudnn/lib:/usr/local/lib/python3.10/site-packages/torch/lib:${LD_LIBRARY_PATH}"
COPY whisper_live /app/whisper_live
COPY run_server.py /app
COPY hybrid_server.py /app
# Expose both WebSocket and HTTP ports
EXPOSE 5000 8080
# Use the hybrid server by default
CMD python3 -u hybrid_server.py --websocket-port 5000 --http-port 8080 --backend faster_whisper
# CMD ["python3", "-u", "run_server.py", "--port", "${PORT_WHISPERLIVE}", "--backend", "faster_whisper", "--faster_whisper_custom_model_path", "/app/models/${FASTERWHISPER_MODEL}", "--ssl_cert_path", "/app/ssl"]
# CMD ["python3", "-u", "run_server.py", "--port", "${PORT_WHISPERLIVE_SSL}", "--backend", "faster_whisper", "--faster_whisper_custom_model_path", "/app/models/${FASTERWHISPER_MODEL}", "--ssl_cert_path", "/app/ssl"]