-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
33 lines (33 loc) · 1.19 KB
/
docker-compose.yml
File metadata and controls
33 lines (33 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
version: '3'
services:
gpt_server:
# 构建
# 为什么每次构建更好?而不是直接使用 image: docker.1ms.run/506610466/gpt_server:latest
# 如果使用 volumes 映射的方式,虽然启动更快,但会影响已启动容器的runtime稳定性,物理机修改的代码会在容器runtime中立马生效。
build:
context: .
dockerfile: Dockerfile.copy
# image: docker.1ms.run/506610466/gpt_server:latest
image: gpt_server:latest_
container_name: gpt_server
shm_size: '32g' # 设置共享内存为4GB
restart: always
# network_mode: host
ports:
- 8082:8082
- 21001:21001
environment:
- TZ:Asia/Shanghai # 设置中国时区
volumes:
- ./gpt_server:/gpt_server/gpt_server # 将最新代码以及配置直接映射到容器中,以运行最新的代码
- /home/dev/model/:/home/dev/model/ # 映射模型路径
deploy:
resources:
reservations:
devices:
- driver: nvidia
# device_ids: [ '0', '1', '2', '3' ]
count: all
# count: 2 # 两种方式
capabilities: [ gpu ]
command: python gpt_server/serving/main.py