From faee7c1afa758da88e1a38dfa8e0d305d2b97969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=90=AA=E4=BA=9A=E5=A8=9C=E8=8A=BD=E8=A1=A3=E8=B4=B4?= =?UTF-8?q?=E8=B4=B4?= <39751846+kisaragychihaya@users.noreply.github.com> Date: Tue, 11 Apr 2023 16:21:56 +0800 Subject: [PATCH] Add Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加Dockerfile 方便部署 --- Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bb4e95a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-runtime +# Downloads to user config dir + +# Install linux packages +ENV DEBIAN_FRONTEND noninteractive +RUN apt update +RUN TZ=Etc/UTC apt install -y tzdata +RUN apt install --no-install-recommends -y gcc git zip curl htop libgl1-mesa-glx libglib2.0-0 libpython3-dev gnupg +# RUN alias python=python3 + +# Security updates +# https://security.snyk.io/vuln/SNYK-UBUNTU1804-OPENSSL-3314796 +RUN apt upgrade --no-install-recommends -y openssl p7zip-full + +# Create working directory +RUN rm -rf /usr/src/app && mkdir -p /usr/src/app + +ADD ChatGLM.7z /usr/src/app/ChatGLM.7z +RUN cd /usr/src/app/ && 7z x ChatGLM.7z && rm ChatGLM.7z +# Copy contents +# COPY . /usr/src/app (issues as not a .git directory) +# RUN git clone https://github.com/ultralytics/yolov5 /usr/src/yolov5 + +# Install pip packages +#COPY requirements.txt . +RUN python3 -m pip install --upgrade pip wheel +RUN python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --no-cache-dir -r /usr/src/app/ChatGLM-6B/requirements.txt +ENV OMP_NUM_THREADS=1 +# Cleanup +ENV DEBIAN_FRONTEND teletype +RUN conda install -y cudatoolkit=11.7 -c nvidia && pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --no-cache-dir streamlit streamlit_chat +EXPOSE 8888 +EXPOSE 8501 +WORKDIR /usr/src/app/ChatGLM-6B +CMD streamlit run web_demo2.py \ No newline at end of file