Comment

Comment by stavepan

Healthchecks are a great way to achieve this.

As this repository mentions, this is the example using PostgreSQL.

depends_on: postgres-database: condition: service_healthy

healthcheck: test: ["CMD-SHELL", "pg_isready"] interval: 10s timeout: 5s retries: 5

However, PostgreSQL has already a command for this called pg_isready.

How is this going to work for other cases such as MySQL?

parent stavepan 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton