jetify-com / devbox

Instant, easy, and predictable development environments
https://www.jetify.com/devbox/
Apache License 2.0
7.83k stars 187 forks source link

Add a readiness_probe for postgresql #2094

Closed mootoday closed 1 month ago

mootoday commented 1 month ago

Summary

This PR adds the following readiness_probe to the postgresql plugin:

    readiness_probe:
      exec:
        command: "pg_isready"

With that change, Devbox users have the ability to create their own processes that depend on a healthy postgresql service. For example, to seed a database, one can add the following to a process-compose.yml:

version: "0.5"
processes:
  seed_db:
    command: |
      npm run db:seed # for example
    depends_on:
      postgresql:
        condition: process_healthy

How was it tested?

In a project with the above process-compose.yml file and the changes in this PR applied to .devbox/virtenv/postgresql/process-compose.yml

Lagoja commented 1 month ago

This is an awesome add, was working with a new Devbox user who was asking about this just last week.