-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
You can't have two CMD statements in one Dockerfile. Each service should have it's own container so I split webserver and llmserver into two containers. ``` docker compose build docker compose up ```
- Loading branch information
Showing
6 changed files
with
99 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
models/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 8000 | ||
|
||
CMD ["python3", "pilot/server/llmserver.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
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 | ||
|
||
RUN python3 -m spacy download zh_core_web_sm | ||
|
||
EXPOSE 7860 | ||
|
||
CMD ["python3", "pilot/server/webserver.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,60 @@ | ||
version: '3.10' | ||
|
||
services: | ||
db-gpt: | ||
db: | ||
image: mysql:8.0.33 | ||
environment: | ||
MYSQL_DATABASE: 'db' | ||
MYSQL_USER: 'user' | ||
MYSQL_PASSWORD: 'password' | ||
MYSQL_ROOT_PASSWORD: 'aa123456' | ||
ports: | ||
- 3306:3306 | ||
volumes: | ||
- my-db:/var/lib/mysql | ||
restart: unless-stopped | ||
webserver: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
image: db-gpt:latest | ||
container_name: db-gpt | ||
dockerfile: Dockerfile-webserver | ||
environment: | ||
- MODEL_SERVER=http://llmserver:8000 | ||
- LOCAL_DB_HOST=db | ||
- WEB_SERVER_PORT=7860 | ||
volumes: | ||
- ./models:/app/models | ||
- ./plugins:/app/plugins | ||
- data:/app/pilot/data | ||
env_file: | ||
- .env.template | ||
ports: | ||
- 7860:7860 | ||
expose: | ||
- 7860 | ||
restart: unless-stopped | ||
llmserver: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile-llmserver | ||
environment: | ||
- LOCAL_DB_HOST=db | ||
volumes: | ||
- ./models:/app/models | ||
env_file: | ||
- .env.template | ||
ports: | ||
- 8000:8000 | ||
- 3306:3306 | ||
restart: unless-stopped | ||
read-only: true | ||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: nvidia | ||
device_ids: ['1'] | ||
capabilities: [gpu] | ||
|
||
|
||
|
||
volumes: | ||
my-db: | ||
data: |