(Have) One Foot in the Grave

What does the idiom “have one foot in the grave” mean?

Definition: to be seemingly near death

Example: I saw Joe yesterday, and it was terrible. He’s been drinking heavily, and I felt like he had one foot in the grave.