diff --git a/16/bullseye/Dockerfile b/16/bullseye/Dockerfile index 53237b4998..8d9fef3b1c 100644 --- a/16/bullseye/Dockerfile +++ b/16/bullseye/Dockerfile @@ -215,5 +215,8 @@ STOPSIGNAL SIGINT # documentation at https://www.postgresql.org/docs/12/server-start.html notes # that even 90 seconds may not be long enough in many instances. +HEALTHCHECK --interval=1s --timeout=1s --retries=60 \ + CMD test -f /dev/shm/ready + EXPOSE 5432 CMD ["postgres"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 0ae0ecf8c2..7169039eb4 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -343,7 +343,11 @@ _main() { fi fi + touch /dev/shm/ready + exec "$@" + + rm /dev/shm/ready } if ! _is_sourced; then