# ArchLinux base
FROM archlinux:base

ARG RELEASE_VERSION

ENV RELEASE_VERSION=${RELEASE_VERSION}

RUN pacman --noconfirm -Sy pyenv

RUN ["/bin/bash", "-c", "pacman --noconfirm -Syu &&\
    pacman --noconfirm -Sy gcc ffmpeg espeak-ng &&\
    pacman --noconfirm -Sy libsndfile &&\
    pacman --noconfirm -Sy libnsl &&\
    pacman --noconfirm -Sy --needed base-devel openssl zlib xz &&\
    /usr/sbin/pyenv install 3.8.12 &&\
    /usr/sbin/pyenv local 3.8.12 &&\
    ln -s /root/.pyenv/versions/3.8.12/bin/python /usr/bin/python &&\
    python -m pip install --upgrade pip &&\
    python3 -m pip install --upgrade \"setuptools<65.0.0\" wheel &&\
    python -m pip install \"subaligner==${RELEASE_VERSION}\" &&\
    python -m pip install \"subaligner[llm]==${RELEASE_VERSION}\""]

COPY ./scripts/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
