Found the solution.
I had to add below setting to my .env file and it worked after that.
DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=false