From 85a715a1f2ab88513751550850b6a863a444fe89 Mon Sep 17 00:00:00 2001 From: DarkSpir Date: Fri, 16 Jun 2023 11:29:46 +0200 Subject: [PATCH] Adding diun, mariadb and redis snippets, update ToDo list in README.md --- README.md | 11 ++++++++++- diun.yml | 27 +++++++++++++++++++++++++++ mariadb.yml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ redis.yml | 15 +++++++++++++++ 4 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 diun.yml create mode 100644 mariadb.yml create mode 100644 redis.yml diff --git a/README.md b/README.md index 3c2d5dd..3902c0c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,16 @@ In this repository I collect docker compose snippets that represent default solutions for containers within a stack file. +## ToDo: + +These are things that need to be fixed up: +- mariadb.yml: Add a few comments to make clear what can and should be changed according to neccessity. +- mariadb.yml: Add an example for clustering settings as well. +- naruadb.yml: Let healthcheck do more than just a ping. +- redis.yml: Add switches for more common use cases like multiple databases or clustering. +- diun.yml: Try to figure out how to configure the content of the setting files within the stack file to get rid of the bind mount. + ## License ![Creative Commons Attribution 4.0 International License](https://i.creativecommons.org/l/by/4.0/88x31.png) -The content in this repository is licensed under Creative Commons Attribution 5.0 International License (CC-BY-4.0). You can view the license text [here](LICENSE) or at [creativecommons.org](http://creativecommons.org/licenses/by/4.0/) \ No newline at end of file +The content in this repository is licensed under Creative Commons Attribution 5.0 International License (CC-BY-4.0). You can view the license text [here](LICENSE) or at [creativecommons.org](http://creativecommons.org/licenses/by/4.0/) diff --git a/diun.yml b/diun.yml new file mode 100644 index 0000000..b755c7e --- /dev/null +++ b/diun.yml @@ -0,0 +1,27 @@ +--- +version: "3.5" + +volumes: + data: + +services: + diun: + image: "ghcr.io/crazy-max/diun:latest" + container_name: diun + command: serve + volumes: + - data:/data + - /var/run/docker.sock:/var/run/docker.sock + - /etc/docker-configs/diun/diun.yaml:/etc/diun/diun.yaml + environment: + - "TZ=Europe/Berlin" + - "LOG_LEVEL=info" + - "LOG_JSON=false" + - "DIUN_WATCH_WORKERS=20" + - "DIUN_WATCH_SCHEDULE=0 0 09 * * *" + - "DIUN_WATCH_JITTER=30s" + - "DIUN_PROVIDERS_DOCKER=true" + labels: + - "diun.enable=true" + restart: unless-stopped +... diff --git a/mariadb.yml b/mariadb.yml new file mode 100644 index 0000000..86101d8 --- /dev/null +++ b/mariadb.yml @@ -0,0 +1,53 @@ +--- +version: "3" + +volumes: + db: + dbbackup: + +services: + db: + image: mariadb:latest + restart: unless-stopped + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + volumes: + - db:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=${PW_MYSQLROOT} + - MYSQL_PASSWORD=${PW_MYSQL} + - MYSQL_DATABASE=${DB_DATABASE} + - MYSQL_USER=${DB_USER} + - MARIADB_AUTO_UPGRADE=1 + - MARIADB_DISABLE_UPGRADE_BACKUP=1 + healthcheck: + test: ['CMD', 'mariadb-admin', 'ping', '-h', 'localhost'] + timeout: 10s + retries: 5 + labels: + diun.enable: true + + db-backup: + image: fradelg/mysql-cron-backup:latest + depends_on: + - db + links: + - db + volumes: + - dbbackup:/backup + environment: + - TZ=Europe/Berlin + - MYSQL_HOST=db + - MYSQL_USER=root + - MYSQL_PASS=${PW_MYSQLROOT} + - MYSQLDUMP_OPTS=--force --single-transaction --quick --compact --extended-insert --order-by-primary + - MAX_BACKUPS=4 + - INIT_BACKUP=1 + # Every day at 00:30 + - CRON_TIME=30 0 * * * + # Make it small + - GZIP_LEVEL=9 + restart: unless-stopped + labels: + diun.enable: true + +... diff --git a/redis.yml b/redis.yml new file mode 100644 index 0000000..8577c09 --- /dev/null +++ b/redis.yml @@ -0,0 +1,15 @@ +--- +version: "3" + +volumes: + redis: + +services: + redis: + image: redis:alpine + volumes: + - redis:/data + restart: unless-stopped + labels: + diun.enable: true +...