Add Dockerfile

pull/412/head
steinvenic 2023-04-06 13:17:27 +08:00 committed by GitHub
parent 801b1bb576
commit bba697abb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

23
Dockerfile Normal file
View File

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