FROM image.sourcefind.cn:5000/gpu/admin/base/jupyterlab-pytorch:2.1.2-py3.10-cuda12.1-ubuntu22.04-devel  as base
ARG IMAGE=nvcomposer
ARG IMAGE_UPPER=NVComposer
ARG BRANCH=gpu
RUN cd /root && git clone -b $BRANCH http://developer.hpccube.com/codes/chenpangpang/$IMAGE.git
WORKDIR /root/$IMAGE/$IMAGE_UPPER
RUN pip install -r requirements.txt


#########
# Prod  #
#########
FROM image.sourcefind.cn:5000/gpu/admin/base/jupyterlab-pytorch:2.1.2-py3.10-cuda12.1-ubuntu22.04-devel
ARG IMAGE=nvcomposer
ARG IMAGE_UPPER=NVComposer
COPY chenyh/$IMAGE/frpc_linux_amd64_* /opt/conda/lib/python3.10/site-packages/gradio/
RUN chmod +x /opt/conda/lib/python3.10/site-packages/gradio/frpc_linux_amd64_*
COPY chenyh/nvcomposer/NVComposer-V0.1.ckpt /root/$IMAGE_UPPER/NVComposer-V0.1.ckpt
COPY --from=base /opt/conda/lib/python3.10/site-packages /opt/conda/lib/python3.10/site-packages
COPY --from=base /root/$IMAGE/$IMAGE_UPPER /root/$IMAGE_UPPER
COPY --from=base /root/$IMAGE/启动器.ipynb /root/$IMAGE/start.sh  /root/
COPY --from=base /root/$IMAGE/assets/  /root/assets/