Can't get postgres to work with pre-existing repo on GitHub

I created a project and had been working on it for a while on my local IDE using GitHub. Now I want to open the project in gitpod but it can’t connect to the database. How can I fix this?

It would be helpful if you share more info, like your repo.

Hi @Sinrock, welcome to the Gitpod community! :tada:

Please see how to set up databases in Gitpod here:

Also, if you’re facing any issues/bugs/questions in that process, please report them here.

https://github.com/Sinrock/four-leaf-clovers.git Sorry about that!

When I use the image file and then start the server it says it can’t reach the DB and to check ports 5432 etc.

Thanks for sharing your repository URL @Sinrock!

How do you use the gitpod/workspace-postgres image? I see no committed .gitpod.yml or Dockerfile in your repository.

The fix would go something like this:

  1. Commit a .gitpod.yml file containing:
image: gitpod/workspace-postgres
  1. Only after the .gitpod.yml has been pushed to GitHub, open your repository in a brand new Gitpod workspace. That new workspace should have a running Postgres server