-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
73 lines (67 loc) · 3.79 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
version: '3.5'
# docker-compose up --detach --scale redis-master=1 --scale redis-replica=4 --scale redis-sentinel=3
services:
redis-master:
image: 'bitnami/redis:latest'
hostname: redis-master
container_name: redis-master
ports:
- '0.0.0.0:16379:6379'
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_REPLICATION_MODE=master
# - REDIS_PASSWORD=bitnami
volumes:
- 'redis:/opt/bitnami/redis/etc/'
redis-replica:
image: 'bitnami/redis:latest'
hostname: redis-replica
ports:
- '6379'
links:
- redis-master
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=redis-master
# - REDIS_MASTER_PASSWORD=bitnami
# - REDIS_PASSWORD=bitnami
redis-sentinel:
hostname: sentinel
image: 'bitnami/redis-sentinel:latest'
networks:
- default
ports:
- '0.0.0.0:26379-26381:26379'
links:
- redis-master
environment:
- ALLOW_EMPTY_PASSWORD=yes
# - REDIS_SENTINEL_RESOLVE_HOSTNAMES=yes # Enables sentinel hostnames support. This is available only for Redis(R) 6.2 or higher. Default: no.
- REDIS_MASTER_HOST=redis-master # Host of the Redis(R) master to monitor. Default: redis.
# - REDIS_MASTER_PORT_NUMBER=16379 # Port of the Redis(R) master to monitor. Default: 6379.
- REDIS_SENTINEL_QUORUM=2 # Number of Sentinels that need to agree about the fact the master is not reachable. Default: 2.
# - REDIS_MASTER_PASSWORD=bitnami # Password to authenticate with the master. No defaults. As an alternative, you can mount a file with the password and set the REDIS_MASTER_PASSWORD_FILE variable.
- REDIS_MASTER_SET=master-node # Name of the set of Redis(R) instances to monitor. Default: mymaster.
# - REDIS_MASTER_USER=bitnami # Username to authenticate with when ACL is enabled for the master. No defaults. This is available only for Redis(R) 6 or higher. If not specified, Redis(R) Sentinel will try to authenticate with just the password (using sentinel auth-pass <master-name> <password>).
#- REDIS_SENTINEL_PORT_NUMBER=26379 #Redis(R) Sentinel port. Default: 26379.
#- REDIS_SENTINEL_PASSWORD=bitnami # Password to authenticate with this sentinel and to authenticate to other sentinels. No defaults. Needs to be identical on all sentinels. As an alternative, you can mount a file with the password and set the REDIS_SENTINEL_PASSWORD_FILE variable.
- REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS=5000 # Number of milliseconds before master is declared down. Default: 60000.
- REDIS_SENTINEL_FAILOVER_TIMEOUT=60000 # Specifies the failover timeout in milliseconds. Default: 180000.
- REDIS_SENTINEL_TLS_ENABLED=no # Whether to enable TLS for traffic or not. Default: no.
#- REDIS_SENTINEL_TLS_PORT_NUMBER: Port used for TLS secure traffic. Default: 26379.
#- REDIS_SENTINEL_TLS_CERT_FILE: File containing the certificate file for the TLS traffic. No defaults.
#- REDIS_SENTINEL_TLS_KEY_FILE: File containing the key for certificate. No defaults.
#- REDIS_SENTINEL_TLS_CA_FILE: File containing the CA of the certificate. No defaults.
#- REDIS_SENTINEL_TLS_DH_PARAMS_FILE: File containing DH params (in order to support DH based ciphers). No defaults.
#- REDIS_SENTINEL_TLS_AUTH_CLIENTS:
#- Whether to require clients to authenticate or not. Default: yes.
- REDIS_SENTINEL_ANNOUNCE_IP=0.0.0.0 # Use the specified IP address in the HELLO messages used to gossip its presence. Default: auto-detected local address.
# - REDIS_SENTINEL_ANNOUNCE_PORT=26379 # Use the specified port in the HELLO messages used to gossip its presence.
networks:
default:
external:
name: microservices_net
volumes:
redis:
driver: local