fleet/docker-compose-redis-cluster.yml

90 lines
2.3 KiB
YAML

---
version: "2"
services:
redis-cluster-setup:
image: redis:5
command: redis-cli --cluster create 172.20.0.31:7001 172.20.0.32:7002 172.20.0.33:7003 172.20.0.34:7004 172.20.0.35:7005 172.20.0.36:7006 --cluster-yes --cluster-replicas 1
networks:
cluster_network:
ipv4_address: 172.20.0.30
depends_on:
- redis-cluster-1
- redis-cluster-2
- redis-cluster-3
- redis-cluster-4
- redis-cluster-5
- redis-cluster-6
redis-cluster-1:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7001:7001"
volumes:
- ./tools/redis-tests/redis-cluster-1.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.31
redis-cluster-2:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7002:7002"
volumes:
- ./tools/redis-tests/redis-cluster-2.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.32
redis-cluster-3:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7003:7003"
volumes:
- ./tools/redis-tests/redis-cluster-3.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.33
redis-cluster-4:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7004:7004"
volumes:
- ./tools/redis-tests/redis-cluster-4.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.34
redis-cluster-5:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7005:7005"
volumes:
- ./tools/redis-tests/redis-cluster-5.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.35
redis-cluster-6:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7006:7006"
volumes:
- ./tools/redis-tests/redis-cluster-6.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.36
networks:
cluster_network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/24