Use or not use git together?

Hello guys!

I’m using a docker in this scenario.

I created a docker-compose.yml with a rails app and postgresql. I made a simple application to test a deploy for production.

My question is:
Is better I make a Docker image with my project and docker-compose.yml or add the docker-compose.yml and Dockerfile in my git to make a deploy?

What is the best way to make a production deploy in my cloud?

Thanks for this!