FROM quay.io/centos/centos:stream8

RUN dnf -y install epel-release && \
    dnf -y install dnf-plugins-core && \
    dnf -y install \
        gcc \
        make \
        git \
        python39-devel \
        python39-pip \
        python39-setuptools && \
    dnf -y copr enable @vespa/vespa centos-stream-8 && \
    dnf -y install --enablerepo=powertools vespa-ann-benchmark

WORKDIR /home/app

COPY requirements.txt run_algorithm.py ./

RUN python3.9 -m pip install -r requirements.txt && \
    python3.9 -m pip install /opt/vespa/libexec/vespa_ann_benchmark

ENTRYPOINT ["python3.9", "-u", "run_algorithm.py"]
