Skip to content

Instantly share code, notes, and snippets.

@jgabriellima
Forked from zhunik/docker-compose.yml
Created March 26, 2022 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgabriellima/804b38ca58a36b57a9e04da3bdac7940 to your computer and use it in GitHub Desktop.
Save jgabriellima/804b38ca58a36b57a9e04da3bdac7940 to your computer and use it in GitHub Desktop.
docker-compose Postgres health-check
version: "3"
services:
postgress:
....
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
app:
...
depends_on:
postgres:
condition: service_healthy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment