-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
73 lines (69 loc) · 1.98 KB
/
docker-compose.yaml
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.0'
services:
master:
image: redis
container_name: redis-master
restart: always
command: redis-server --port 6379 --requirepass test@dbuser2018 --appendonly yes
ports:
- 6379:6379
volumes:
- './db/redis/data/master:/data'
slave1:
image: redis
container_name: redis-slave-1
restart: always
command: redis-server --slaveof redis-master 6379 --port 6379 --requirepass test@dbuser2018 --masterauth test@dbuser2018 --appendonly yes
ports:
- 6380:6379
volumes:
- './db/redis/data/node1:/data'
slave2:
image: redis
container_name: redis-slave-2
restart: always
command: redis-server --slaveof redis-master 6379 --port 6379 --requirepass test@dbuser2018 --masterauth test@dbuser2018 --appendonly yes
ports:
- 6381:6379
volumes:
- './db/redis/data/node2:/data'
sentinel1:
image: redis ## 镜像
container_name: redis-sentinel-1
restart: always
ports:
- '26379:26379'
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
volumes:
- './db/redis/sentinel1.conf:/usr/local/etc/redis/sentinel.conf'
sentinel2:
image: redis ## 镜像
container_name: redis-sentinel-2
restart: always
ports:
- '26380:26379'
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
volumes:
- './db/redis/sentinel2.conf:/usr/local/etc/redis/sentinel.conf'
sentinel3:
image: redis ## 镜像
container_name: redis-sentinel-3
restart: always
ports:
- '26381:26379'
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
volumes:
- ./db/redis/sentinel3.conf:/usr/local/etc/redis/sentinel.conf
db:
image: mysql:oracle
container_name: db
restart: always
volumes:
- ./db/mysql:/docker-entrypoint-initdb.d
environment:
- 'MYSQL_ROOT_PASSWORD=123456'
- 'MYSQL_DATABASE=psyduck'
- 'MYSQL_USER=lemonpai'
- 'MYSQL_PASSWORD=123456'
ports:
- 3306:3306