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 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/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 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/
