docker-compose.yml 555 B

123456789101112131415161718192021
  1. version: '2.2'
  2. services:
  3. redis_master:
  4. image: redis:5
  5. container_name: redis_master --port 6479
  6. ports:
  7. - '0.0.0.0:6479:6479'
  8. redis_slave:
  9. image: redis:5
  10. container_name: redis_slave
  11. command: redis-server --port 6480 --slaveof "${EXTERNAL_HOST}" 6479 --slave-announce-ip "${EXTERNAL_HOST}"
  12. ports:
  13. - '0.0.0.0:6480:6380'
  14. sentinel:
  15. build: ./sentinel
  16. container_name: redis_sentinel
  17. ports:
  18. - '0.0.0.0:26379:26379'
  19. environment:
  20. - SENTINEL_NAME=mysentinel
  21. - HOST_IP="${EXTERNAL_HOST}"