mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-31 12:54:04 +02:00
Add healthcheckscript for postgres
This commit is contained in:
@@ -121,4 +121,4 @@ HEALTHCHECK \
|
|||||||
--retries=5 \
|
--retries=5 \
|
||||||
--start-period=90s \
|
--start-period=90s \
|
||||||
--timeout=25s \
|
--timeout=25s \
|
||||||
CMD pg_isready --dbname="${POSTGRES_DB}" --username="${POSTGRES_USER}" || exit 1
|
CMD /usr/local/bin/healthcheck.sh
|
||||||
|
|||||||
7
postgres_15/rootfs/usr/local/bin/healthcheck.sh
Normal file
7
postgres_15/rootfs/usr/local/bin/healthcheck.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bashio
|
||||||
|
# shellcheck shell=bash
|
||||||
|
|
||||||
|
POSTGRES_USER="$(bashio::config "POSTGRES_USER" "postgres")"
|
||||||
|
POSTGRES_DB="$(bashio::config "POSTGRES_DB" "$POSTGRES_USER")"
|
||||||
|
|
||||||
|
pg_isready --dbname="${POSTGRES_DB}" --username="${POSTGRES_USER}" || exit $?;
|
||||||
7
postgres_17/rootfs/usr/local/bin/healthcheck.sh
Normal file
7
postgres_17/rootfs/usr/local/bin/healthcheck.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bashio
|
||||||
|
# shellcheck shell=bash
|
||||||
|
|
||||||
|
POSTGRES_USER="$(bashio::config "POSTGRES_USER" "postgres")"
|
||||||
|
POSTGRES_DB="$(bashio::config "POSTGRES_DB" "$POSTGRES_USER")"
|
||||||
|
|
||||||
|
pg_isready --dbname="${POSTGRES_DB}" --username="${POSTGRES_USER}" || exit $?;
|
||||||
Reference in New Issue
Block a user