From 0ffc23312a10bf0b2e37a7be3d9bb0f06a8935a3 Mon Sep 17 00:00:00 2001 From: casjay Date: Tue, 4 Oct 2022 23:03:23 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 1 + bin/entrypoint-nextcloud.sh | 12 +++++++----- bin/healthcheck | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index f542d0b..b1d1e36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN mkdir -p /bin/ /config/ /data/ /dist/nextcloud/ && \ echo "http://dl-cdn.alpinelinux.org/alpine/$ALPINE_VERSION/testing" >> /etc/apk/repositories && \ apk update -U --no-cache \ apk add --no-cache \ + openrc \ icu-data-full \ curl \ gnupg \ diff --git a/bin/entrypoint-nextcloud.sh b/bin/entrypoint-nextcloud.sh index f38ec02..1d70532 100755 --- a/bin/entrypoint-nextcloud.sh +++ b/bin/entrypoint-nextcloud.sh @@ -94,7 +94,7 @@ fi [ -f "/etc/.env.sh" ] && rm -Rf "/etc/.env.sh" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Additional commands - +[ -f "/run/openrc/softlevel" ] || openrc -n sysinit # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case "$1" in --help) # Help message @@ -102,12 +102,13 @@ case "$1" in echo "Usage: $APPNAME [healthcheck, bash, command]" echo "Failed command will have exit code 10" echo - exitCode=$? + exit $? ;; healthcheck) # Docker healthcheck - /usr/local/bin/healthcheck - exitCode=$? + netstat -taupln | grep -q "php-fpm" && + netstat -taupln | grep -q "nginx" + exit $? ;; */bin/sh | */bin/bash | bash | shell | sh) # Launch shell @@ -118,7 +119,8 @@ healthcheck) # Docker healthcheck *) # Execute primary command if [ $# -eq 0 ]; then - __exec_bash "/bin/bash" + /etc/init.d/php-fpm8 status | grep 'status: started' || /etc/init.d/php8-fpm start + /etc/init.d/nginx status | grep 'status: started' || /etc/init.d/nginx start else __exec_bash "/bin/bash" fi diff --git a/bin/healthcheck b/bin/healthcheck index 042b6a3..2827038 100755 --- a/bin/healthcheck +++ b/bin/healthcheck @@ -6,5 +6,5 @@ if [ "$SIDECAR_NEWSUPDATER" = "1" ]; then elif [ "$SIDECAR_CRON" = "1" ] || [ "$SIDECAR_PREVIEWGEN" = "1" ]; then pgrep -f "busybox crond -f -L /dev/stdout" else - curl --fail http://127.0.0.1:12345/ping || exit 1 + curl --fail http://127.0.0.1:80/ping || exit 1 fi