-
-
Save buihien0109/0cb4d0fa02b93fe566bd84632a8e9f02 to your computer and use it in GitHub Desktop.
This file contains 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.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