<!-- Thank you for doing recipe maintenance work! Please mark all checklist items which are relevant for your changes. Please remove the checklist items which are not relevant for your changes. Feel free to remove this comment. --> * [x] I have deployed and tested my changes * [x] I have [updated relevant versions in `abra.sh`](https://docs.coopcloud.tech/maintainers/upgrade/#updating-versions-in-the-abrash) * [x] I have made my environment variable changes [backwards compatible](https://docs.coopcloud.tech/maintainers/upgrade/#backwards-compatible-environment-variable-changes) * [x] I ran `abra recipe lint uptime-kuma --chaos` on the PR's branch and fixed the warnings. * [ ] I have added a [release note entry](https://docs.coopcloud.tech/maintainers/upgrade/#creating-new-release-notes) Reviewed-on: https://git.coopcloud.tech/coop-cloud/uptime-kuma/pulls/14 Co-authored-by: stevensting <stefan@klasse-methode.it> Co-committed-by: stevensting <stefan@klasse-methode.it>
60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
---
|
|
version: "3.8"
|
|
|
|
services:
|
|
app:
|
|
secrets:
|
|
- db_password
|
|
networks:
|
|
- internal
|
|
environment:
|
|
- UPTIME_KUMA_DB_TYPE=mariadb
|
|
- UPTIME_KUMA_DB_HOSTNAME=db
|
|
- UPTIME_KUMA_DB_PORT=3306
|
|
- UPTIME_KUMA_DB_NAME=kuma
|
|
- UPTIME_KUMA_DB_USERNAME=kuma
|
|
- UPTIME_KUMA_DB_PASSWORD_FILE=/run/secrets/db_password
|
|
depends_on:
|
|
- db
|
|
|
|
db:
|
|
image: mariadb:12.3
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
|
|
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
|
|
- MYSQL_USER=kuma
|
|
- MYSQL_DATABASE=kuma
|
|
volumes:
|
|
- mariadb:/var/lib/mysql
|
|
networks:
|
|
- internal
|
|
secrets:
|
|
- db_password
|
|
- db_root_password
|
|
deploy:
|
|
labels:
|
|
backupbot.backup: "${ENABLE_BACKUPS:-true}"
|
|
backupbot.backup.pre-hook: "mariadb-dump --single-transaction -u root -p\"$$(cat /run/secrets/db_root_password)\" kuma | gzip > /var/lib/mysql/dump.sql.gz"
|
|
backupbot.backup.volumes.mariadb.path: "dump.sql.gz"
|
|
backupbot.restore.post-hook: "gzip -d /var/lib/mysql/dump.sql.gz && mariadb -u root -p\"$$(cat /run/secrets/db_root_password)\" kuma < /var/lib/mysql/dump.sql && rm -f /var/lib/mysql/dump.sql"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", 'mariadb-admin -u"$$MYSQL_USER" -p"$$(cat $$MYSQL_PASSWORD_FILE)" ping']
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 10
|
|
start_period: 1m
|
|
|
|
volumes:
|
|
mariadb:
|
|
|
|
networks:
|
|
internal:
|
|
|
|
secrets:
|
|
db_password:
|
|
external: true
|
|
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
|
|
db_root_password:
|
|
external: true
|
|
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
|