forked from coop-cloud/nextcloud
healthchecks (#32)
Adding healthchecks for nginx, mariadb, redis and php-fpm Co-authored-by: Moritz <moritz.m@local-it.org> Reviewed-on: coop-cloud/nextcloud#32
This commit is contained in:
parent
92bc8b0b68
commit
b08bb5903f
|
@ -31,6 +31,12 @@ services:
|
|||
backupbot.backup.pre-hook: 'mkdir -p /tmp/backup/ && mysqldump --single-transaction -u root -p"$$(cat /run/secrets/db_root_password)" nextcloud > /tmp/backup/backup.sql'
|
||||
backupbot.backup.post-hook: "rm -rf /tmp/backup"
|
||||
backupbot.backup.path: "/tmp/backup/"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", 'mysqladmin -p"$$(cat /run/secrets/db_root_password)" ping']
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 1m
|
||||
configs:
|
||||
my_tune:
|
||||
name: ${STACK_NAME}_my_cnf_${MY_CNF_VERSION}
|
||||
|
|
17
compose.yml
17
compose.yml
|
@ -33,6 +33,12 @@ services:
|
|||
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", 'curl -s -N curl -Ns localhost/status.php | grep "installed\":true"']
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 1m
|
||||
|
||||
app:
|
||||
image: nextcloud:25.0.1-fpm
|
||||
|
@ -83,6 +89,12 @@ services:
|
|||
- "coop-cloud.${STACK_NAME}.version=3.0.1+25.0.1-fpm"
|
||||
- "backupbot.backup=true"
|
||||
- "backupbot.backup.path=/var/www/html/config/,/var/www/html/data/,/var/www/html/custom_apps/"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", 'SCRIPT_NAME=status SCRIPT_FILENAME=/var/www/html/status.php REQUEST_METHOD=GET cgi-fcgi -bind -connect 127.0.0.1:9000 | grep "installed\":true"']
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 1m
|
||||
|
||||
cron:
|
||||
image: nextcloud:25.0.1-fpm
|
||||
|
@ -102,6 +114,11 @@ services:
|
|||
- internal
|
||||
volumes:
|
||||
- "redis:/data"
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 3s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
|
||||
secrets:
|
||||
db_root_password:
|
||||
|
|
|
@ -34,6 +34,8 @@ if ! [[ $(grep {{ env "X_FRAME_OPTIONS_ALLOW_FROM" }} lib/public/AppFramework/Ht
|
|||
fi
|
||||
{{ end }}
|
||||
|
||||
# Required for healthcheck
|
||||
which cgi-fcgi > /dev/null || (apt-get update && apt-get install -y libfcgi-bin)
|
||||
|
||||
|
||||
/entrypoint.sh php-fpm
|
||||
|
|
Loading…
Reference in New Issue