Created
March 7, 2018 11:25
-
-
Save kapad/18b97013ad6a29664e6e32b4a4939656 to your computer and use it in GitHub Desktop.
docker compose master slave configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
networks: | |
redismasterslave: | |
driver: bridge | |
ipam: | |
driver: default | |
config: | |
- subnet: 172.18.0.0/16 | |
services: | |
redis-master: | |
image: 'bitnami/redis:latest' | |
environment: | |
- ALLOW_EMPTY_PASSWORD=yes | |
- REDIS_REPLICATION_MODE=master | |
container_name: redis-master | |
networks: | |
redismasterslave: | |
aliases: | |
- redis-master | |
ipv4_address: 172.18.0.10 | |
redis-slave: | |
image: 'bitnami/redis:latest' | |
environment: | |
- ALLOW_EMPTY_PASSWORD=yes | |
- REDIS_REPLICATION_MODE=slave | |
- REDIS_MASTER_HOST=master | |
container_name: redis-slave | |
depends_on: | |
- redis-master | |
networks: | |
redismasterslave: | |
aliases: | |
- redis-slave | |
ipv4_address: 172.18.0.11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment