-
Notifications
You must be signed in to change notification settings - Fork 425
Expand file tree
/
Copy pathdocker-compose.cpu.yml
More file actions
94 lines (90 loc) · 2.11 KB
/
Copy pathdocker-compose.cpu.yml
File metadata and controls
94 lines (90 loc) · 2.11 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
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
85
86
87
88
89
90
91
92
93
94
services:
celery_worker:
build:
context: .
args:
CPU_ONLY: "true"
image: docling-api:cpu
command: celery -A worker.celery_config worker --pool=solo -n worker_primary --loglevel=info
user: "10001:10001"
security_opt:
- no-new-privileges:true
volumes:
- model_cache:/models
environment:
REDIS_HOST: redis://redis:6379/0
ENV: production
MALLOC_ARENA_MAX: "2"
OMP_NUM_THREADS: "2"
PYTHONMALLOC: malloc
restart: on-failure
depends_on:
- redis
app:
container_name: docling-api-cpu
build:
context: .
args:
CPU_ONLY: "true"
image: docling-api:cpu
command: uvicorn --port 8080 --host 0.0.0.0 main:app
user: "10001:10001"
security_opt:
- no-new-privileges:true
environment:
REDIS_HOST: redis://redis:6379/0
ENV: production
MALLOC_ARENA_MAX: "2"
OMP_NUM_THREADS: "2"
PYTHONMALLOC: malloc
MAX_SIZE_PER_FILE_MB: "${MAX_SIZE_PER_FILE_MB:-100}"
MAX_BATCH_SIZE_MB: "${MAX_BATCH_SIZE_MB:-500}"
ports:
- "8080:8080"
volumes:
- model_cache:/models
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health', timeout=5).read()",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: on-failure
depends_on:
- redis
redis:
container_name: docling-api-redis
image: redis:7.2.4-alpine
ports:
- "6379:6379"
restart: on-failure
flower:
container_name: docling-api-flower-cpu
build:
context: .
args:
CPU_ONLY: "true"
image: docling-api:cpu
command: celery -A worker.celery_config flower --port=5555
user: "10001:10001"
security_opt:
- no-new-privileges:true
ports:
- "5556:5555"
volumes:
- model_cache:/models
environment:
REDIS_HOST: redis://redis:6379/0
ENV: production
restart: on-failure
depends_on:
- redis
- celery_worker
volumes:
model_cache: