Skip to content

Instantly share code, notes, and snippets.

@buihien0109
Created July 26, 2021 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buihien0109/0cb4d0fa02b93fe566bd84632a8e9f02 to your computer and use it in GitHub Desktop.
Save buihien0109/0cb4d0fa02b93fe566bd84632a8e9f02 to your computer and use it in GitHub Desktop.
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