Our application looks good, as we can now create events and we have a frontend and backend automatically running when we start workspaces. However, our APIs won’t work yet, as they need to be configured to use a database. With Gitpod you can connect to externally hosted databases. However, for simplicity, in this tutorial we’re going to set up a database that runs in our workspace. To help installing our database we’re going to use Gitpod workspace iamges.Documentation Index
Fetch the complete documentation index at: https://ona.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Understanding workspace images
When no image is referenced in the.gitpod.yml workspaces use the workspace-full image by default, which comes with many commonly used utilities. If you want to override the workspace image you can reference a built Docker image.
.gitpod.yml
.gitpod.yml
Installing Postgres
For our example we’ll use Postgres with the Gitpod PostgresQL workspace image. Copy the following line into your.gitpod.yml file:
.gitpod.yml
5432. Let’s add a port configuration to define and ignore that port in our .gitpod.yml.
Again, copy the following lines into your .gitpod.yml file:
.gitpod.yml
Database seeding
Finally, let’s automate the creation of our schema, and any necessary data seeding. For that, let’s add ourinit-db.sh script to our .gitpod.yml. Copy the following into the tasks block that we created earlier:
.gitpod.yml