You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
services:
|
|
|
|
springboot:
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
container_name: springboot
|
|
|
|
depends_on:
|
|
|
|
- redis1
|
|
|
|
- redis2
|
|
|
|
- redis3
|
|
|
|
- sentinel1
|
|
|
|
- sentinel2
|
|
|
|
- sentinel3
|
|
|
|
networks:
|
|
|
|
redisnet:
|
|
|
|
ipv4_address: 172.23.0.10
|
|
|
|
ports:
|
|
|
|
- "8060:8060"
|
|
|
|
redis1:
|
|
|
|
image: redis:alpine
|
|
|
|
container_name: redis1
|
|
|
|
ports:
|
|
|
|
- "26379:6379"
|
|
|
|
command: redis-server /usr/local/etc/redis/redis.conf
|
|
|
|
volumes:
|
|
|
|
- ./redis/redis1.conf:/usr/local/etc/redis/redis.conf
|
|
|
|
networks:
|
|
|
|
redisnet:
|
|
|
|
ipv4_address: 172.23.0.4
|
|
|
|
redis2:
|
|
|
|
image: redis:alpine
|
|
|
|
container_name: redis2
|
|
|
|
ports:
|
|
|
|
- "36379:6379"
|
|
|
|
command: redis-server /usr/local/etc/redis/redis.conf
|
|
|
|
volumes:
|
|
|
|
- ./redis/redis2.conf:/usr/local/etc/redis/redis.conf
|
|
|
|
networks:
|
|
|
|
redisnet:
|
|
|
|
ipv4_address: 172.23.0.5
|
|
|
|
|
|
|
|
redis3:
|
|
|
|
image: redis:alpine
|
|
|
|
container_name: redis3
|
|
|
|
ports:
|
|
|
|
- "46379:6379"
|
|
|
|
command: redis-server /usr/local/etc/redis/redis.conf
|
|
|
|
volumes:
|
|
|
|
- ./redis/redis3.conf:/usr/local/etc/redis/redis.conf
|
|
|
|
networks:
|
|
|
|
redisnet:
|
|
|
|
ipv4_address: 172.23.0.6
|
|
|
|
sentinel1:
|
|
|
|
image: redis:alpine
|
|
|
|
container_name: sentinel1
|
|
|
|
depends_on:
|
|
|
|
- redis1
|
|
|
|
ports:
|
|
|
|
- "26380:26379"
|
|
|
|
command: redis-sentinel /usr/local/etc/sentinel/sentinel.conf
|
|
|
|
volumes:
|
|
|
|
- ./sentinel1:/usr/local/etc/sentinel
|
|
|
|
extra_hosts:
|
|
|
|
- "redis1:172.23.0.4"
|
|
|
|
- "redis2:172.23.0.5"
|
|
|
|
- "redis3:172.23.0.6"
|
|
|
|
networks:
|
|
|
|
redisnet:
|
|
|
|
ipv4_address: 172.23.0.7
|
|
|
|
sentinel2:
|
|
|
|
image: redis:alpine
|
|
|
|
container_name: sentinel2
|
|
|
|
depends_on:
|
|
|
|
- redis1
|
|
|
|
ports:
|
|
|
|
- "26381:26379"
|
|
|
|
command: redis-sentinel /usr/local/etc/sentinel/sentinel.conf
|
|
|
|
volumes:
|
|
|
|
- ./sentinel2:/usr/local/etc/sentinel
|
|
|
|
extra_hosts:
|
|
|
|
- "redis1:172.23.0.4"
|
|
|
|
- "redis2:172.23.0.5"
|
|
|
|
- "redis3:172.23.0.6"
|
|
|
|
networks:
|
|
|
|
redisnet:
|
|
|
|
ipv4_address: 172.23.0.8
|
|
|
|
sentinel3:
|
|
|
|
image: redis:alpine
|
|
|
|
container_name: sentinel3
|
|
|
|
depends_on:
|
|
|
|
- redis1
|
|
|
|
ports:
|
|
|
|
- "26382:26379"
|
|
|
|
command: redis-sentinel /usr/local/etc/sentinel/sentinel.conf
|
|
|
|
volumes:
|
|
|
|
- ./sentinel3:/usr/local/etc/sentinel
|
|
|
|
extra_hosts:
|
|
|
|
- "redis1:172.23.0.4"
|
|
|
|
- "redis2:172.23.0.5"
|
|
|
|
- "redis3:172.23.0.6"
|
|
|
|
networks:
|
|
|
|
redisnet:
|
|
|
|
ipv4_address: 172.23.0.9
|
|
|
|
|
|
|
|
networks:
|
|
|
|
redisnet:
|
|
|
|
driver: bridge
|
|
|
|
ipam:
|
|
|
|
config:
|
|
|
|
- subnet: 172.23.0.0/16
|