FROM nvcr.io/nvidia/tritonserver:22.04-py3


RUN apt-key adv --fetch-keys \
    https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub && \
    apt-get update                                && \
    apt-get install -y software-properties-common && \
    add-apt-repository ppa:deadsnakes/ppa         && \
    apt-get update                                && \
    apt-get install -y         \
              zip              \
              wget             \
              unzip            \
              python3.8        \
              python3-pip      \
              libgl1-mesa-glx

RUN pip3 install -U pip

RUN pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

RUN pip3 install pyarrow onnxruntime

RUN pip3 install towhee.compiler
RUN pip3 install towhee towhee.models

RUN apt-get install git-lfs && \
    git lfs install

WORKDIR /workspace

RUN mkdir -p /workspace/models

COPY ./dag.json /workspace/dag.json

RUN triton_builder /workspace/dag.json /workspace/models

