redis.yml 538 B

123456789101112131415161718
  1. redis:
  2. image: redis:latest
  3. command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
  4. ports:
  5. - "6379:6379"
  6. volumes:
  7. - redis_data:/data
  8. - ./data/config/redis.conf:/usr/local/etc/redis/redis.conf:ro
  9. healthcheck:
  10. test:
  11. - CMD-SHELL
  12. - 'PORT_HEX="$(printf ''%04X'' 6379)"; cat /proc/net/tcp /proc/net/tcp6 2>/dev/null | grep -q ":$${PORT_HEX} "'
  13. interval: 5s
  14. timeout: 3s
  15. retries: 20
  16. start_period: 10s
  17. stop_grace_period: 30s
  18. restart: unless-stopped