Will now try and connect to the db frist for upto 10 seconds

This handles the case where the postgres container is still starting up
when the migrations run.