Make Hubot start with Docker Compose when RocketChat

I am using rocket.chat with docker-compose, additionally I use the hubot.
My problem is, that I always have to manually stop and restart hubot, because it starts to early, can’t get a connection to rocket.chat and then fails without retrying.

I got the idea, that it could be possible to add a line like here for the mongodb, to let hubot check, is rocket chat is ready.

command: bash -c ‘for i in seq 1 30; do node main.js && s=$$? && break || s=$$?; echo “Tried $$i times. Waiting 5 secs…”; sleep 5; done; (exit $$s)’

https://github.com/RocketChat/Rocket.Chat/blob/develop/docker-compose.yml

Does someone know, what this line could be?

Did you solve the issue? I successfully set up running Hubot following the latest instruction at https://rocket.chat/docs/installation/docker-containers/#6-create-the-docker-composeyml-file--local-directories