-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
119 lines (109 loc) · 2.42 KB
/
docker-compose.prod.yml
File metadata and controls
119 lines (109 loc) · 2.42 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
115
116
117
118
119
# Docker Compose for Production Environment
# 3+ replicas, full resources, comprehensive logging and monitoring
version: '3.8'
services:
inferno-1:
extends:
file: docker-compose.yml
service: inferno
container_name: inferno-prod-1
ports:
- "8001:8000"
environment:
INFERNO_LOG_LEVEL: warn
RUST_LOG: info
deploy:
resources:
limits:
cpus: '2.0'
memory: 4G
reservations:
cpus: '1.5'
memory: 3G
inferno-2:
extends:
file: docker-compose.yml
service: inferno
container_name: inferno-prod-2
ports:
- "8002:8000"
environment:
INFERNO_LOG_LEVEL: warn
RUST_LOG: info
deploy:
resources:
limits:
cpus: '2.0'
memory: 4G
reservations:
cpus: '1.5'
memory: 3G
inferno-3:
extends:
file: docker-compose.yml
service: inferno
container_name: inferno-prod-3
ports:
- "8003:8000"
environment:
INFERNO_LOG_LEVEL: warn
RUST_LOG: info
deploy:
resources:
limits:
cpus: '2.0'
memory: 4G
reservations:
cpus: '1.5'
memory: 3G
# Production: Load balancer with health checks
nginx:
image: nginx:latest
container_name: inferno-lb
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.prod.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- inferno-1
- inferno-2
- inferno-3
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 30s
timeout: 5s
retries: 3
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
# Prometheus for monitoring
prometheus:
image: prom/prometheus:latest
container_name: inferno-prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=30d'
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
volumes:
prometheus:
driver: local
driver_opts:
type: none
o: bind
device: ./data/prometheus