Restart docker on failure

Hello guys

I found this nice article about how to put in a health check for the docker container, and restart it if it doesn’t reply properly:

However it mentions to change the docker composer file, which I cannot find in
Do I need to create a new one? Or am I looking in the wrong place?
I am running on a virtual ubuntu server.