-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (25 loc) · 822 Bytes
/
Makefile
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
.PHONY: config
config:
docker build --target redis --tag redis:cluster .
docker build --target sentinel --tag redis:sentinel .
docker build --target haproxy --tag redis:haproxy .
docker network create redis-network --subnet 172.23.0.0/24 || true
rm -rf redis01 redis02 redis03
mkdir -p redis01 redis02 redis03
cp redis.conf sentinel.conf redis01/
cp redis.conf sentinel.conf redis02/
cp redis.conf sentinel.conf redis03/
echo 'replica-priority 100' >> redis01/redis.conf
echo 'replica-priority 200' >> redis02/redis.conf
echo 'replica-priority 200' >> redis03/redis.conf
echo 'replicaof 172.23.0.11 6379' >> redis02/redis.conf
echo 'replicaof 172.23.0.11 6379' >> redis03/redis.conf
.PHONY: up
up:
docker-compose up -d
.PHONY: start
start:
docker-compose start
.PHONY: down
down:
docker-compose down