From bba697abb016363100b637838fd80ebce344d614 Mon Sep 17 00:00:00 2001 From: steinvenic <761701732@qq.com> Date: Thu, 6 Apr 2023 13:17:27 +0800 Subject: [PATCH] Add Dockerfile --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..31bae68 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM nvidia/cuda:11.4.0-cudnn8-runtime-ubuntu20.04 +LABEL maintainer="steinven@outlook.it" +LABEL version="1.0" +LABEL description="ChatGLM-6B" + +#github网速太慢或被墙,使用码云加速 +ENV REPO_LINK=https://gitee.com/xiaoyaolangzi/ChatGLM-6B.git + + +#安装所需的库文件 +RUN sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list;apt update;apt install git -y \ + && apt install python3 python3-pip -y \ + && pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/web/simple \ + && git clone --depth=1 $REPO_LINK /ChatGLM-6B \ + && pip install -r /ChatGLM-6B/requirements.txt + +WORKDIR /ChatGLM-6B +EXPOSE 7860 + +CMD ["python3","web_demo.py"] + +#可以根据将web_demo.py下载到宿主机,通过挂载的方式,修改参数 +#运行示例:docker run -it --gpus all -p 7860:7860 -v $PWD/web_demo.py:/ChatGLM-6B/web_demo.py IMAGE_ID \ No newline at end of file