Correct way of writing Docker-Compose for given Docker commands for Kong

I am trying to write docker-compose yaml for the given docker commands to run Kong. I am unable to do so because I am not able to correctly include the apis for upstream_url. Can someone please tell me how to do so? I am including the link of the question posted on stackoverflow : https://stackoverflow.com/questions/49507124/dockerizing-kong-to-run-in-a-automated-fashion-and-setting-the-upstream-urls-dyn

Found a way to create an image of Kong and incorporate within the container the set of docker commands in order to set upstream URLs and also deploy postgres.