How do you perform a HEALTHCHECK in the Redis Docker image?

Although the ping operation from @nitrin0 answer generally works. It does not handle the case where the write operation will actually fail. So instead I perform a change that will just increment a value to a key I don’t plan to use.

image: redis:6
healthcheck:
  test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)