-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
67 lines (64 loc) · 1.6 KB
/
docker-compose.yml
File metadata and controls
67 lines (64 loc) · 1.6 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
services:
redis:
image: redis:7-alpine
restart: unless-stopped
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
api:
build: .
restart: unless-stopped
environment:
- SERVICE_URL_API_3000
- TASK_BACKEND=dramatiq
- REDIS_URL=redis://redis:6379/0
- PORT=3000
- TOKENIZERS_PARALLELISM=false
- OMP_NUM_THREADS=4
- MKL_NUM_THREADS=4
- NUMEXPR_NUM_THREADS=1
- MALLOC_ARENA_MAX=2
- JOB_STALE_RUNNING_SECONDS=900
env_file:
- .env
ports:
- "${API_PORT:-3001}:3000"
volumes:
- app_data:/app/data
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import os,urllib.request; port=os.getenv('PORT','3000'); urllib.request.urlopen(f'http://localhost:{port}/health').read()"]
interval: 30s
timeout: 10s
start_period: 5s
retries: 3
worker:
build: .
restart: unless-stopped
command: python -m dramatiq taxomind.workers.tasks --processes 1 --threads 1
environment:
- TASK_BACKEND=dramatiq
- REDIS_URL=redis://redis:6379/0
- TOKENIZERS_PARALLELISM=false
- OMP_NUM_THREADS=1
- MKL_NUM_THREADS=1
- NUMEXPR_NUM_THREADS=1
- MALLOC_ARENA_MAX=2
- API_REUSE_PIPELINE_SESSIONS=false
- JOB_STALE_RUNNING_SECONDS=900
env_file:
- .env
volumes:
- app_data:/app/data
depends_on:
redis:
condition: service_healthy
volumes:
redis_data:
app_data: