fixed docker compose

This commit is contained in:
Joe Crypto 2023-06-22 18:41:55 +00:00
parent b968727836
commit dc8f62f3f8
5 changed files with 50 additions and 9 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
models/

4
.gitignore vendored
View File

@ -25,10 +25,10 @@ lib/
lib64/
parts/
sdist/
models
var/
wheels/
models/
models/*
pip-wheel-metadata/
share/python-wheels/
*.egg-info/

View File

@ -10,10 +10,12 @@ WORKDIR /app
COPY . /app
RUN pip install -r requirements.txt
EXPOSE 7860
# upgrade pip
RUN pip3 install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 8000
CMD ["python", "pilot/server/llmserver.py"]
CMD ["python", "pilot/server/webserver.py"]
CMD ["python3", "pilot/server/llmserver.py"]

21
Dockerfile-webserver Normal file
View File

@ -0,0 +1,21 @@
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
RUN apt-get update && apt-get install -y \
git \
python3 \
pip
WORKDIR /app
COPY . /app
# upgrade pip
RUN pip3 install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 7860
CMD ["python3", "pilot/server/webserver.py"]

View File

@ -13,16 +13,31 @@ services:
volumes:
- my-db:/var/lib/mysql
restart: unless-stopped
db-gpt:
webserver:
build:
context: .
dockerfile: Dockerfile
container_name: db-gpt
dockerfile: Dockerfile-webserver
environment:
- MODEL_SERVER=http://llmserver:8000
- LOCAL_DB_HOST=db
env_file:
- .env
ports:
- 7860:7860
expose:
- 7860
restart: unless-stopped
llmserver:
build:
context: .
dockerfile: Dockerfile-llmserver
volumes:
- ./models:/app/models
env_file:
- .env
ports:
- 8000:8000
restart: unless-stopped
deploy:
resources:
reservations:
@ -31,5 +46,7 @@ services:
device_ids: ['1', '0']
capabilities: [gpu]
volumes:
my-db: