-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.gpu.yml
More file actions
58 lines (54 loc) · 1.53 KB
/
Copy pathdocker-compose.gpu.yml
File metadata and controls
58 lines (54 loc) · 1.53 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
version: '3.9'
# GPU-enabled docker-compose configuration
# Requires: nvidia-docker2 or Docker with GPU support
# Usage: docker-compose -f docker-compose.gpu.yml up
services:
api:
build:
context: .
args:
BASE_IMAGE: nvidia/cuda:12.1-runtime-ubuntu22.04
command: python tool/main.py gui --host 0.0.0.0 --port 5000
ports:
- "5000:5000"
volumes:
- ./input:/app/input
- ./output:/app/output
- ./config:/app/config
- ~/.cache/huggingface:/root/.cache/huggingface
environment:
- SEAMLESS_DEVICE=cuda
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-0}
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api/system/status"]
interval: 30s
timeout: 10s
retries: 3
worker:
build:
context: .
args:
BASE_IMAGE: nvidia/cuda:12.1-runtime-ubuntu22.04
command: python tool/main.py worker --num-workers ${NUM_WORKERS:-1}
volumes:
- ./input:/app/input
- ./output:/app/output
- ./config:/app/config
- ~/.cache/huggingface:/root/.cache/huggingface
environment:
- SEAMLESS_DEVICE=cuda
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- NUM_WORKERS=${NUM_WORKERS:-1}
- CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-0}
restart: unless-stopped
depends_on:
- api
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]