-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.cpu.yml
72 lines (67 loc) · 1.45 KB
/
docker-compose.cpu.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
version: "3.8"
services:
celery_worker:
build:
context: .
args:
CPU_ONLY: "true"
image: converter-cpu-image
command: poetry run celery -A worker.celery_config worker --pool=solo -n worker_primary --loglevel=info
volumes:
- .:/app
- model_cache:/tmp
environment:
- REDIS_HOST=${REDIS_HOST}
- ENV=production
restart: on-failure
depends_on:
- redis
app:
container_name: marker-api-cpu
build:
context: .
args:
CPU_ONLY: "true"
image: converter-cpu-image
command: poetry run uvicorn --port 8080 --host 0.0.0.0 main:app
environment:
- REDIS_HOST=${REDIS_HOST}
- ENV=production
- MALLOC_ARENA_MAX=2
- OMP_NUM_THREADS=2
- PYTHONMALLOC=malloc
ports:
- "8080:8080"
volumes:
- .:/app
- model_cache:/tmp
restart: on-failure
depends_on:
- redis
redis:
container_name: redis
image: redis:7.2.4-alpine
ports:
- "6379:6379"
flower:
container_name: flower_cpu
build:
context: .
args:
CPU_ONLY: "true"
image: converter-cpu-image
command: poetry run celery -A worker.celery_config flower --port=5555
ports:
- "5556:5555"
volumes:
- .:/app
- model_cache:/tmp
environment:
- REDIS_HOST=${REDIS_HOST}
- ENV=production
depends_on:
- app
- redis
- celery_worker
volumes:
model_cache: