-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
114 lines (108 loc) · 2.83 KB
/
docker-compose.prod.yml
File metadata and controls
114 lines (108 loc) · 2.83 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Docker Compose — Production Override
# AI Product Photo Detector
#
# Usage: docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build
#
# Features:
# - No debug, WARNING-level logging
# - Gunicorn with multiple workers
# - Resource limits (CPU + memory)
# - Strict health checks
# - No mounted volumes (images are self-contained)
# - Always-restart policy
services:
api:
image: ai-product-detector:latest
environment:
- AIDETECT_LOG_LEVEL=WARNING
- REQUIRE_AUTH=true
- MLFLOW_TRACKING_URI=http://mlflow:5000
command: ["gunicorn", "src.inference.api:app", "-k", "uvicorn.workers.UvicornWorker", "-w", "4", "-b", "0.0.0.0:8080", "--timeout", "120", "--graceful-timeout", "30", "--access-logfile", "-"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/healthz"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
restart: always
deploy:
resources:
limits:
cpus: "2.0"
memory: 2G
reservations:
cpus: "0.5"
memory: 512M
ui:
image: ai-product-detector-ui:latest
restart: always
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
reservations:
cpus: "0.25"
memory: 128M
mlflow:
volumes:
- mlflow-data:/mlflow
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
restart: always
deploy:
resources:
limits:
cpus: "1.0"
memory: 1G
reservations:
cpus: "0.25"
memory: 256M
prometheus:
volumes:
- ./configs/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:9090/-/healthy"]
interval: 30s
timeout: 5s
retries: 3
restart: always
deploy:
resources:
limits:
cpus: "0.5"
memory: 512M
reservations:
cpus: "0.1"
memory: 128M
grafana:
environment:
- GF_SECURITY_ADMIN_USER=${GF_ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GF_ADMIN_PASSWORD:?GF_ADMIN_PASSWORD must be set}
- GF_AUTH_ANONYMOUS_ENABLED=false
volumes:
- grafana-data:/var/lib/grafana
- ./configs/grafana/provisioning:/etc/grafana/provisioning:ro
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/api/health"]
interval: 30s
timeout: 5s
retries: 3
restart: always
deploy:
resources:
limits:
cpus: "0.5"
memory: 512M
reservations:
cpus: "0.1"
memory: 128M
volumes:
mlflow-data:
prometheus-data:
grafana-data: