add docker deployment

pull/314/head
daihui 2023-07-17 20:37:08 +08:00
parent 3a534decf2
commit db43bce59c
2 changed files with 5 additions and 3 deletions

View File

@ -10,7 +10,7 @@ services:
working_dir: /app
ports:
- "9000:8000"
command: bash -c "python api.py"
command: bash -c "python web_demo.py"
deploy:
resources:
reservations:

View File

@ -9,8 +9,10 @@ RUN apt update && apt-get -y install git wget \
RUN ln -s /usr/bin/python3.10 /usr/bin/python
RUN useradd -ms /bin/bash usera
WORKDIR /app
ADD . .
ADD .requirements .
RUN pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple
RUN pip config set global.trusted-host mirrors.cloud.tencent.com
RUN pip install -r requirements.txt --no-cache-dir
ADD . .
# preinstall model
RUN python -c "from transformers import AutoTokenizer, AutoModel; AutoModel.from_pretrained('THUDM/chatglm2-6b', trust_remote_code=True)"