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:
https://justyn.io/blog/how-to-restart-home-assistant-docker-container-automatically-on-failure/

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