-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
84 lines (80 loc) · 1.91 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
84 lines (80 loc) · 1.91 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
version: '3.8'
services:
bioanalyzer package:
build:
context: .
dockerfile: Dockerfile
container_name: bioanalyzer-p-prod
env_file:
- .env
environment:
- UVICORN_RELOAD=false
- LOG_LEVEL=INFO
- ENVIRONMENT=production
ports:
- "8000:8000"
volumes:
- ./cache:/app/cache
- ./logs:/app/logs
- ./results:/app/results
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 40s
restart: unless-stopped
deploy:
resources:
limits:
cpus: '2'
memory: 4G
reservations:
cpus: '1'
memory: 2G
networks:
- bioanalyzer-net
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"
# Not used by the application today (rate limiting/caching are in-memory
# and SQLite-backed respectively — see app/api/middleware/rate_limit.py
# and app/services/cache_manager.py). Provisioned for future production
# use only; the app service does not depend on it to start.
redis:
image: redis:7-alpine
container_name: bioanalyzer-redis-prod
command: ["redis-server", "--appendonly", "yes", "--maxmemory", "512mb", "--maxmemory-policy", "allkeys-lru"]
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.5'
memory: 1G
reservations:
cpus: '0.25'
memory: 512M
networks:
- bioanalyzer-net
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
redis-data:
driver: local
networks:
bioanalyzer-net:
driver: bridge