Skip to content

Instantly share code, notes, and snippets.

@buihien0109
Created Jul 26, 2021
Embed
What would you like to do?
version: "3.8"
networks:
my-network:
external: true
services:
redis:
image: redis
command: redis-server --requirepass mypassword
ports:
- "6379:6379"
volumes:
- /redis1:/data
networks:
- my-network
deploy:
placement:
constraints:
- node.role == manager
- node.hostname == 192.168.0.26
redis-slave:
image: redis
command: redis-server --masterauth mypassword --slaveof redis 6379
depends_on:
- redis
ports:
- "6380:6379"
volumes:
- /redis2:/data
networks:
- my-network
deploy:
placement:
constraints:
- node.role == manager
- node.hostname == 192.168.0.27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment