You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.3 KiB

FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
##
## User.
##
RUN apt update && apt install -y sudo
RUN groupadd -r user
RUN useradd -r -g user -m -s /bin/bash user
RUN usermod -aG sudo user
RUN echo "user ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers
USER user
WORKDIR /home/user
ENV USER=user
##
## Time zone.
##
ENV TZ=Europe/Moscow
RUN sudo ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
RUN echo $TZ | sudo tee /etc/timezone
##
## RealTimeSTT.
##
RUN sudo apt update && sudo apt install -y python3
RUN sudo apt update && sudo apt install -y python3-pip
RUN sudo apt update && sudo apt install -y python3-venv
RUN sudo apt update && sudo apt install -y portaudio19-dev
RUN sudo apt update && sudo apt install -y ffmpeg
RUN python3 -m venv venv
RUN bash -c "source venv/bin/activate && pip install RealtimeSTT==0.3.7"
RUN bash -c "source venv/bin/activate && pip install torch==2.3.1+cu121 --index-url https://download.pytorch.org/whl/cu121"
RUN bash -c "source venv/bin/activate && pip install torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121"
##
## Replace `localhost` with `0.0.0.0` in STT server.
##
RUN bash -c "source venv/bin/activate && \
cd ~/venv/lib/python3.12/site-packages/RealtimeSTT_server && \
find . -type f -exec sed -i.backup "s/localhost/0\.0\.0\.0/g" {} \;"