1. version: '2'
    2. networks:
    3. app-tier:
    4. driver: bridge
    5. services:
    6. redis:
    7. image: 'bitnami/redis:latest'
    8. environment:
    9. - REDIS_REPLICATION_MODE=master
    10. - REDIS_PASSWORD=str0ng_passw0rd
    11. networks:
    12. - app-tier
    13. ports:
    14. - '6379'
    15. redis-slave:
    16. image: 'bitnami/redis:latest'
    17. environment:
    18. - REDIS_REPLICATION_MODE=slave
    19. - REDIS_MASTER_HOST=redis
    20. - REDIS_MASTER_PASSWORD=str0ng_passw0rd
    21. - REDIS_PASSWORD=str0ng_passw0rd
    22. ports:
    23. - '6379'
    24. depends_on:
    25. - redis
    26. networks:
    27. - app-tier
    28. redis-sentinel:
    29. image: 'bitnami/redis-sentinel:latest'
    30. environment:
    31. - REDIS_MASTER_PASSWORD=str0ng_passw0rd
    32. depends_on:
    33. - redis
    34. - redis-slave
    35. ports:
    36. - '26379-26381:26379'
    37. networks:
    38. - app-tier