Docker – check if postgres is ready
Here is a shell one liner using pg_isready tool provided by PostgreSQL. To call outside docker: DOCKER_CONTAINER_NAME=”mypgcontainer” timeout 90s bash -c “until docker exec $DOCKER_CONTAINER_NAME pg_isready ; do sleep 5 ; done” Based on a post from Jeroma Belleman.