How to dockerize PDI jobs with postgres?

I am trying to dockerize pdi server but I am unable to run jobs with postgres in docker.

Source: StackOverflow