Created
May 14, 2021 22:34
-
-
Save bschaatsbergen/59bac068de292dd236c9724fb7fbb08b to your computer and use it in GitHub Desktop.
Dockerized Primary/Replica Redis
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.9" | |
services: | |
redis-primary: | |
container_name: redis-primary | |
image: redis:latest | |
command: redis-server --port 6379 | |
ports: | |
- "6379:6379" | |
redis-replica: | |
container_name: redis-replica | |
image: redis:latest | |
command: redis-server --slaveof redis-primary 6379 | |
ports: | |
- "6380:6379" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run this by typing
docker compose-up -d
on the same level as thedocker-compose.yml
resides