Automatically fetch code from github enterprise

Hello,

I am currently running a few containers. All the code is on my Github Enterprise account, and till now, everytime I push a commit to the production branch of the code, I have to fetch the code on the host, rebuild the image. I am trying to find an easy way whereby I just commit the code to Github, have perhaps a webhook attached and the Docker daemon should automatically pull the code, rebuild the image and run the updated container.

Can someone please guide me to appropriate documentation on such a possibility which I can explore? I read somewhere previously that this was perhaps possible through docker-compose but cannot find the link now.

Thanks

see https://stackoverflow.com/questions/8371173/how-to-get-notified-when-someone-pushes-into-a-github-branch

i don’t think u can hook docker directly, but can fire a script which does the work