FROM python:3.9

RUN apt-get update --yes && \
    # - apt-get upgrade is run to patch known vulnerabilities in apt-get packages as
    #   the ubuntu base image is rebuilt too seldom sometimes (less than once a month)
    apt-get upgrade --yes && \
    apt-get install --yes --no-install-recommends \
    # - bzip2 is necessary to extract the micromamba executable.
    bzip2 \
    ca-certificates \
    fonts-liberation \
    locales \
    # - pandoc is used to convert notebooks to html files
    #   it's not present in arm64 ubuntu image, so we install it here
    pandoc \
    sudo \
    # - tini is installed as a helpful container entrypoint that reaps zombie
    #   processes and such of the actual executable we want to start, see
    #   https://github.com/krallin/tini#why-tini for details.
    tini \
    vim \
    python-dev \
    zsh \
    sox \
    libsndfile1 \
    ffmpeg \
    libmecab-dev \
    wget && \
    apt-get clean && apt autoremove -y && \ 
    echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
    locale-gen

SHELL ["/bin/zsh", "-o", "pipefail", "-c"]

RUN sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

RUN apt install -y python3-pip #  && pip3 install virtualenv

WORKDIR /app


COPY ./ops/install_openfst.sh /app
COPY ./ops/install_nemo.sh /app


# RUN /app/install_openfst.sh
RUN  /app/install_nemo.sh
RUN python -c "from nemo_text_processing.text_normalization.normalize_with_audio import NormalizerWithAudio"

WORKDIR /code
COPY ./suno_utils /code 
RUN pip install -e .


