-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.loadbalancer.yml
More file actions
73 lines (68 loc) · 1.58 KB
/
Copy pathdocker-compose.loadbalancer.yml
File metadata and controls
73 lines (68 loc) · 1.58 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
version: '3.8'
services:
# Nginx load balancer
nginx:
image: nginx:alpine
ports:
- "6379:6379" # Redis protocol
- "8080:8080" # HTTP management
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- hypercache-1
- hypercache-2
- hypercache-3
restart: unless-stopped
# HyperCache nodes - Docker handles service discovery
hypercache-1:
build: .
environment:
- NODE_ID=node-1
- RESP_PORT=8080
- HTTP_PORT=9080
- GOSSIP_PORT=7080
- CLUSTER_SEEDS=hypercache-1:7080,hypercache-2:7080,hypercache-3:7080
expose:
- "8080"
- "9080"
- "7080"
volumes:
- ./data/node-1:/data
restart: unless-stopped
hypercache-2:
build: .
environment:
- NODE_ID=node-2
- RESP_PORT=8080
- HTTP_PORT=9080
- GOSSIP_PORT=7080
- CLUSTER_SEEDS=hypercache-1:7080,hypercache-2:7080,hypercache-3:7080
expose:
- "8080"
- "9080"
- "7080"
volumes:
- ./data/node-2:/data
restart: unless-stopped
hypercache-3:
build: .
environment:
- NODE_ID=node-3
- RESP_PORT=8080
- HTTP_PORT=9080
- GOSSIP_PORT=7080
- CLUSTER_SEEDS=hypercache-1:7080,hypercache-2:7080,hypercache-3:7080
expose:
- "8080"
- "9080"
- "7080"
volumes:
- ./data/node-3:/data
restart: unless-stopped
# Optional: Redis CLI for testing
redis-cli:
image: redis:alpine
command: ["redis-cli", "-h", "nginx", "-p", "6379"]
depends_on:
- nginx
profiles: ["tools"]