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.
64 lines
1.7 KiB
64 lines
1.7 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
|
|
|
|
##
|
|
## RealTimeTTS.
|
|
##
|
|
|
|
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 sudo apt update && sudo apt install -y espeak # System TTS for TTS server.
|
|
RUN sudo apt update && sudo apt install -y git
|
|
|
|
RUN python3 -m venv venv
|
|
|
|
RUN bash -c "source venv/bin/activate && pip install 'RealTimeTTS[all]==0.4.10'"
|
|
RUN bash -c "source venv/bin/activate && pip install torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121"
|
|
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 fastapi==0.115.5" # For TTS server.
|
|
RUN bash -c "source venv/bin/activate && pip install uvicorn==0.32.0" # For TTS server.
|
|
|
|
RUN git clone --depth 1 https://github.com/KoljaB/RealtimeTTS && \
|
|
cd RealtimeTTS && \
|
|
git reset --hard b2fab8b57717d2a14501923e9cf2b5589944b9ca
|
|
|
|
##
|
|
## Replaces.
|
|
##
|
|
|
|
RUN bash -c "source venv/bin/activate && \
|
|
cd RealtimeTTS/example_fast_api && \
|
|
sed -i.backup \"s/START_ENGINE = SUPPORTED_ENGINES\[0\]/START_ENGINE = 'coqui'/g\" server.py"
|
|
|