-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathdocker-compose.gpu.yml
84 lines (80 loc) · 1.74 KB
/
docker-compose.gpu.yml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
version: "3.8"
services:
celery_worker:
build:
context: .
args:
CPU_ONLY: "false"
image: converter-gpu-image
command: poetry run celery -A worker.celery_config worker --pool=solo -n worker_primary --loglevel=info
volumes:
- .:/app
environment:
- REDIS_HOST=${REDIS_HOST}
- ENV=production
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
depends_on:
- redis
app:
container_name: marker-api-gpu
build:
context: .
args:
CPU_ONLY: "false"
image: converter-gpu-image
command: poetry run uvicorn --port 8080 --host 0.0.0.0 main:app
environment:
- REDIS_HOST=${REDIS_HOST}
- ENV=production
- NVIDIA_VISIBLE_DEVICES=all
ports:
- "8080:8080"
volumes:
- .:/app
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
depends_on:
- redis
- celery_worker
redis:
container_name: redis
image: redis:7.2.4-alpine
ports:
- "6379:6379"
flower:
container_name: flower_gpu
build:
context: .
args:
CPU_ONLY: "false"
image: converter-gpu-image
command: poetry run celery -A worker.celery_config flower --port=5555
ports:
- "5556:5555"
volumes:
- .:/app
environment:
- REDIS_HOST=${REDIS_HOST}
- ENV=production
depends_on:
- app
- redis
- celery_worker
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]