-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-example.yml
67 lines (67 loc) · 1.69 KB
/
docker-compose-example.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
version: "3"
services:
redis-master:
image: redis:${REDIS_VERSION}
container_name: redis-master
ports:
- ${REDIS_HOST_PORT}:6379
- ${REDIS_SENTINEL_1_HOST_PORT}:26379
volumes:
- ${REDIS_CONF_DIR}:/etc/redis
- ${REDIS_DATA_DIR}:/data
- ${REDIS_LOG_DIR}:/var/log/redis
restart: always
networks:
default:
ipv4_address: 172.20.0.4
environment:
TZ: ${TIMEZONE}
privileged: true
command: ["/bin/bash","/etc/redis/start.sh"]
redis-slave-1:
image: redis:${REDIS_VERSION}
container_name: redis-slave-1
ports:
- ${REDIS_SLAVE_1_HOST_PORT}:6379
- ${REDIS_SENTINEL_2_HOST_PORT}:26379
volumes:
- ${REDIS_SLAVE_1_CONF_DIR}:/etc/redis
- ${REDIS_SLAVE_1_DATA_DIR}:/data
- ${REDIS_SLAVE_1_LOG_DIR}:/var/log/redis
restart: always
depends_on:
- redis-master
networks:
default:
ipv4_address: 172.20.0.5
environment:
TZ: ${TIMEZONE}
privileged: true
command: ["/bin/bash","/etc/redis/start.sh"]
redis-slave-2:
image: redis:${REDIS_VERSION}
container_name: redis-slave-2
ports:
- ${REDIS_SLAVE_2_HOST_PORT}:6379
- ${REDIS_SENTINEL_3_HOST_PORT}:26379
volumes:
- ${REDIS_SLAVE_2_CONF_DIR}:/etc/redis
- ${REDIS_SLAVE_2_DATA_DIR}:/data
- ${REDIS_SLAVE_2_LOG_DIR}:/var/log/redis
restart: always
depends_on:
- redis-master
networks:
default:
ipv4_address: 172.20.0.6
environment:
TZ: ${TIMEZONE}
privileged: true
command: ["/bin/bash","/etc/redis/start.sh"]
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.20.0.0/24