bitnami / containers

Bitnami container images
https://bitnami.com
Other
3.31k stars 4.79k forks source link

add healthcheck to postgres #72745

Open olivierdalang opened 6 days ago

olivierdalang commented 6 days ago

Name and Version

bitnami/postgresql:15 (and of course other versions too)

What is the problem this feature will solve?

Making sure the postgres container is properly started before other services relying on it start by making it possible to use the depends_on/condition/service_healthy directive in docker-compose

What is the feature you are proposing to solve the problem?

Adding HEALTHCHECK directives in the dockerfile with some reasonable defaults. Here I use something like this (docker-compose):

services:
  ...
  postgres:
    image: bitnami/postgresql:15
    ...
    healthcheck:
      test: pg_isready -U postgres
      interval: 5s
      retries: 6
      start_period: 1s

What alternatives have you considered?

Adding them manually in my docker-compose / kubernetes configs - of course doable

carrodher commented 15 hours ago

Thank you for bringing this issue to our attention. We appreciate your involvement! If you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.