FROM image.sourcefind.cn:5000/dcu/admin/base/jupyterlab-pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10 as base
RUN cd /root && git clone -b dcu https://developer.hpccube.com/codes/chenpangpang/tile-upscaler
WORKDIR /root/tile-upscaler/Tile-Upscaler
RUN pip install -r requirements.txt
COPY chenyh/tile-upscaler/models /root/tile-upscaler/Tile-Upscaler/models
COPY chenyh/tile-upscaler/CompVis /root/tile-upscaler/Tile-Upscaler/CompVis

#########
# Prod  #
#########
FROM image.sourcefind.cn:5000/dcu/admin/base/jupyterlab-pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10
RUN apt-get update && apt-get install -y libglib2.0-0 libgl1-mesa-glx
COPY chenyh/tile-upscaler/frpc_linux_amd64_v0.2 /opt/conda/lib/python3.10/site-packages/gradio/
RUN chmod +x /opt/conda/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.2
COPY --from=base /opt/conda/lib/python3.10/site-packages /opt/conda/lib/python3.10/site-packages
COPY --from=base /root/tile-upscaler/Tile-Upscaler /root/Tile-Upscaler
COPY --from=base /root/tile-upscaler/启动器.ipynb /root/tile-upscaler/start.sh /root/
