FROM image.sourcefind.cn:5000/gpu/admin/base/jupyterlab-pytorch:2.2.0-python3.10-cuda12.1-ubuntu22.04 as base
RUN cd /root && git clone -b gpu http://developer.hpccube.com/codes/chenpangpang/instantid.git
WORKDIR /root/instantid/InstantID
COPY chenyh/InstantID/InstantID /root/instantid/InstantID/checkpoints
COPY chenyh/InstantID/antelopev2 /root/instantid/InstantID/models/antelopev2
COPY chenyh/InstantID/wangqixun /root/instantid/InstantID/wangqixun
RUN apt-get update && apt-get install -y gcc g++
RUN pip install -r gradio_demo/requirements.txt && \
    pip install onnxruntime-gpu==1.18.0 --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/

#########
# Prod  #
#########
FROM image.sourcefind.cn:5000/gpu/admin/base/jupyterlab-pytorch:2.2.0-python3.10-cuda12.1-ubuntu22.04
RUN apt-get update && apt-get install -y libglib2.0-0 libgl1-mesa-glx
COPY --from=base /opt/conda/lib/python3.10/site-packages /opt/conda/lib/python3.10/site-packages
COPY --from=base /root/instantid/InstantID /root/InstantID
COPY --from=base /root/instantid/启动器.ipynb /root/instantid/run.sh /root/
