diff --git a/Containers/apache/healthcheck.sh b/Containers/apache/healthcheck.sh index 667c94d3..4f34c5eb 100644 --- a/Containers/apache/healthcheck.sh +++ b/Containers/apache/healthcheck.sh @@ -1,5 +1,6 @@ #!/bin/bash +nc -z "$NEXTCLOUD_HOST" 9000 || exit 0 curl -skfI localhost:8000 || exit 1 if [ "$APACHE_PORT" != '443' ]; then nc -z localhost "$APACHE_PORT" || exit 1 diff --git a/Containers/nextcloud/Dockerfile b/Containers/nextcloud/Dockerfile index 61df8d6f..435a7f41 100644 --- a/Containers/nextcloud/Dockerfile +++ b/Containers/nextcloud/Dockerfile @@ -250,4 +250,4 @@ RUN echo "root:$(openssl rand -base64 12)" | chpasswd USER root ENTRYPOINT ["/start.sh"] -HEALTHCHECK CMD (sudo -u www-data nc -z localhost 9000 && sudo -u www-data nc -z localhost 7867) || exit 1 \ No newline at end of file +HEALTHCHECK CMD (sudo -u www-data nc -z "$POSTGRES_HOST" 5432 || exit 0) && (sudo -u www-data nc -z localhost 9000 && sudo -u www-data nc -z localhost 7867) || exit 1 \ No newline at end of file diff --git a/Containers/postgresql/Dockerfile b/Containers/postgresql/Dockerfile index d69d63b1..89d59abf 100644 --- a/Containers/postgresql/Dockerfile +++ b/Containers/postgresql/Dockerfile @@ -32,4 +32,4 @@ RUN echo "root:$(openssl rand -base64 12)" | chpasswd USER postgres ENTRYPOINT ["start.sh"] -HEALTHCHECK CMD psql -d "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "select now()" || exit 1 \ No newline at end of file +HEALTHCHECK CMD (test -f "/mnt/data/backup-is-running" && exit 0) && psql -d "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "select now()" || exit 1 \ No newline at end of file