-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
135 lines (128 loc) · 3.29 KB
/
docker-compose.prod.yml
File metadata and controls
135 lines (128 loc) · 3.29 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
version: '3.8'
services:
# AI Predictor Service
predictor:
build:
context: ./predictor
dockerfile: Dockerfile
ports:
- "${PREDICTOR_PORT:-5000}:5000"
environment:
- PREDICTOR_HOST=${PREDICTOR_HOST:-0.0.0.0}
- PREDICTOR_PORT=${PREDICTOR_PORT:-5000}
- AI_MODEL_TYPE=${AI_MODEL_TYPE:-xgboost}
- AI_PREDICTION_THRESHOLD=${AI_PREDICTION_THRESHOLD:-0.7}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
volumes:
- predictor_data:/app/data
- ./logs:/app/logs
networks:
- vmm_network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# C++ Backend Service
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "${BACKEND_PORT:-8080}:8080"
environment:
- BACKEND_HOST=${BACKEND_HOST:-0.0.0.0}
- BACKEND_PORT=${BACKEND_PORT:-8080}
- PREDICTOR_URL=http://predictor:5000
- VMM_TOTAL_FRAMES=${VMM_TOTAL_FRAMES:-256}
- VMM_PAGE_SIZE=${VMM_PAGE_SIZE:-4096}
- VMM_TOTAL_PAGES=${VMM_TOTAL_PAGES:-1024}
- VMM_REPLACEMENT_POLICY=${VMM_REPLACEMENT_POLICY:-CLOCK}
- VMM_ENABLE_AI=${VMM_ENABLE_AI:-true}
- WORKLOAD_TYPE=${WORKLOAD_TYPE:-RANDOM}
- WORKLOAD_TOTAL_REQUESTS=${WORKLOAD_TOTAL_REQUESTS:-1000}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
volumes:
- backend_data:/app/data
- ./logs:/app/logs
networks:
- vmm_network
depends_on:
predictor:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/metrics"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# React Frontend Service
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "${FRONTEND_PORT:-3000}:80"
environment:
- REACT_APP_BACKEND_URL=http://localhost:${BACKEND_PORT:-8080}
- REACT_APP_PREDICTOR_URL=http://localhost:${PREDICTOR_PORT:-5000}
- NODE_ENV=${NODE_ENV:-production}
networks:
- vmm_network
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Redis for caching (optional)
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- vmm_network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# Nginx Reverse Proxy
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
- ./logs/nginx:/var/log/nginx
networks:
- vmm_network
depends_on:
- frontend
- backend
- predictor
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/health"]
interval: 30s
timeout: 10s
retries: 3
volumes:
predictor_data:
backend_data:
redis_data:
networks:
vmm_network:
driver: bridge