-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.nvidia.yml
More file actions
42 lines (41 loc) · 1.51 KB
/
Copy pathdocker-compose.nvidia.yml
File metadata and controls
42 lines (41 loc) · 1.51 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
# NVIDIA GPU worker overlay. Requires a Linux host with an NVIDIA GPU and the
# nvidia-container-toolkit installed and configured for Docker.
#
# Run alongside the base stack:
# docker compose -f docker-compose.yml -f docker-compose.nvidia.yml up -d --build
#
# Verify GPU access first: docker run --rm --gpus all nvidia/cuda:12.4.1-base nvidia-smi
#
# This overlay only adds the GPU worker. The datastore/API port hardening and
# reverse-proxy guidance live in docker-compose.yml (see its PRODUCTION NOTES);
# they apply unchanged here. The worker is compute-heavy — we do NOT cap its
# CPU/memory (that would throttle OCR); the GPU is granted via the reservations
# block below. Set an explicit mem limit only if the host is memory-constrained.
services:
nvidia-worker:
image: ghcr.io/dim145/subtitleextractor-worker-nvidia:${IMAGE_TAG:-latest}
hostname: nvidia-worker
container_name: nvidia-worker
build:
context: ./worker
dockerfile: Dockerfile.nvidia
restart: unless-stopped
environment:
API_BASE_URL: http://api:8080
INTERNAL_API_TOKEN: ${INTERNAL_API_TOKEN}
WORKER_CLASS: gpu-nvidia
PPOCR_USE_GPU: "1"
WORKER_DECODER: ffmpeg
WORKER_HWACCEL: cuda
NVIDIA_VISIBLE_DEVICES: all
NVIDIA_DRIVER_CAPABILITIES: compute,utility,video
depends_on:
api:
condition: service_healthy
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]