-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
121 lines (112 loc) · 3 KB
/
docker-compose.yml
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
version: '3.3'
# millionaire $ netstat -a -n | grep "LIST"
# tcp4 0 0 127.0.0.1.55380 *.* LISTEN
# tcp4 0 0 127.0.0.1.39624 *.* LISTEN
# tcp4 0 0 127.0.0.1.55350 *.* LISTEN
# tcp4 0 0 127.0.0.1.26380 *.* LISTEN
# tcp4 0 0 127.0.0.1.26379 *.* LISTEN
# tcp4 0 0 127.0.0.1.6380 *.* LISTEN
# tcp4 0 0 127.0.0.1.6379 *.* LISTEN
# tcp4 0 0 127.0.0.1.54246 *.* LISTEN
# tcp4 0 0 127.0.0.1.54247 *.* LISTEN
# tcp46 0 0 *.53741 *.* LISTEN
# tcp4 0 0 127.0.0.1.63342 *.* LISTEN
# tcp4 0 0 127.0.0.1.6942 *.* LISTEN
# root@0fedc9edd30e:/data# redis-cli --version
# redis-cli 7.0.11
services:
## http://dmitrypol.github.io/redis/2020/10/01/redis-sentinel.html
redis-master:
image: redis
container_name: redis-master
ports:
- "6379:6379"
networks:
vpnet:
ipv4_address: 172.25.0.11
cpus: "0.5"
mem_reservation: "128M"
mem_limit: "256M"
redis-slave:
image: redis
container_name: redis-slave
command: redis-server --port 6380 --slaveof redis-master 6379
links:
- redis-master
ports:
- "6380:6380"
networks:
vpnet:
ipv4_address: 172.25.0.12
cpus: "0.5"
mem_reservation: "128M"
mem_limit: "256M"
redis-sentinel1:
container_name: redis-sentinel1
build:
context: ./redis-sentinel
links:
- redis-master
ports:
- "26379:26379"
networks:
vpnet:
ipv4_address: 172.25.0.13
cpus: "0.5"
mem_reservation: "128M"
mem_limit: "256M"
redis-sentinel2:
container_name: redis-sentinel2
build:
context: ./redis-sentinel
links:
- redis-master
ports:
- "26380:26379"
networks:
vpnet:
ipv4_address: 172.25.0.14
cpus: "0.5"
mem_reservation: "128M"
mem_limit: "256M"
cache-vista-app:
container_name: cache-vista
build:
context: .
depends_on:
- redis-master
- redis-sentinel1
- redis-sentinel2
links:
- redis-master
- redis-sentinel1
- redis-sentinel2
networks:
vpnet:
ipv4_address: 172.25.0.15
cpus: "0.5"
mem_reservation: "184M"
mem_limit: "512M"
## docker-compose 3
# resources:
# limits:
# cpus: 1
# memory: 786m
# reservations:
# cpus: 0.5
# memory: 150m
memcached:
image: memcached:latest
ports:
- "11211:11211"
cpus: "0.5"
mem_reservation: "50M"
mem_limit: "512M"
networks:
vpnet:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.25.0.0/24
# gateway: 172.25.0.1