FROM ubuntu:22.04
# Install system dependencies and Python 3.10
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-venv \
python3-pip \
python3-dev \
curl \
bash \
build-essential \
libsndfile1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y ffmpeg
# Set up virtual environment
ENV VIRTUAL_ENV=/opt/openvoice
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip
# RUN apt-get update && apt-get install -y python3-dev build-essential
# Install torch and other dependencies
RUN pip install --no-cache-dir torch setuptools>=40.8.0 langid fastapi soundfile librosa inflect unidecode eng_to_ipa pypinyin jieba
RUN pip install cn2an pydub faster_whisper whisper_timestamped
RUN pip install --upgrade setuptools
# Expose the ports used by the application
EXPOSE 8000
# Copy application code
COPY . .
# Create a startup script
RUN echo '#!/bin/bash\n\
source /opt/openvoice/bin/activate\n\
python tts_2.py' > /start.sh && chmod +x /start.sh
# Run the application
CMD ["/bin/bash", "/start.sh"]
FROM ubuntu:22.04
# Install system dependencies and Python 3.10
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-venv \
python3-pip \
python3-dev \
curl \
bash \
build-essential \
libsndfile1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y ffmpeg
# Set up virtual environment
ENV VIRTUAL_ENV=/opt/openvoice
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip
# RUN apt-get update && apt-get install -y python3-dev build-essential
# Install torch and other dependencies
RUN pip install --no-cache-dir torch setuptools>=40.8.0 langid fastapi soundfile librosa inflect unidecode eng_to_ipa pypinyin jieba
RUN pip install cn2an pydub faster_whisper whisper_timestamped
RUN pip install --upgrade setuptools
# Expose the ports used by the application
EXPOSE 8000
# Copy application code
COPY . .
# Create a startup script
RUN echo '#!/bin/bash\n\
source /opt/openvoice/bin/activate\n\
python tts_2.py' > /start.sh && chmod +x /start.sh
# Run the application
CMD ["/bin/bash", "/start.sh"]