From cbd57bf3381793ea0c2cd23b26b811fe26772b2c Mon Sep 17 00:00:00 2001 From: ryuupendragon Date: Sun, 20 Jul 2025 16:13:24 +0530 Subject: [PATCH] Add templates for mariadb, postgres, and valkey --- .templates/mariadb.yml | 21 +++++++++++++++++++++ .templates/postgres.yml | 19 +++++++++++++++++++ .templates/valkey.yml | 16 ++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 .templates/mariadb.yml create mode 100644 .templates/postgres.yml create mode 100644 .templates/valkey.yml diff --git a/.templates/mariadb.yml b/.templates/mariadb.yml new file mode 100644 index 0000000..5b2c226 --- /dev/null +++ b/.templates/mariadb.yml @@ -0,0 +1,21 @@ +services: + db: + container_name: db + image: docker.io/library/mariadb:11.8.2 + restart: unless-stopped + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} + volumes: + - ${APPDATA_PATH}//db:/var/lib/mysql + ports: + - ${DB_PORT}:3306 + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + interval: 10s + timeout: 5s + retries: 3 + start_period: 10s diff --git a/.templates/postgres.yml b/.templates/postgres.yml new file mode 100644 index 0000000..a343ab1 --- /dev/null +++ b/.templates/postgres.yml @@ -0,0 +1,19 @@ +services: + db: + container_name: db + image: docker.io/library/postgres:17.5 + restart: unless-stopped + environment: + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_DB=${POSTGRES_DB} + volumes: + - ${APPDATA_PATH}//db:/var/lib/postgresql/data + ports: + - ${DB_PORT}:5432 + healthcheck: + test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"] + interval: 10s + timeout: 5s + retries: 3 + start_period: 10s diff --git a/.templates/valkey.yml b/.templates/valkey.yml new file mode 100644 index 0000000..f1131de --- /dev/null +++ b/.templates/valkey.yml @@ -0,0 +1,16 @@ +services: + valkey: + container_name: valkey + image: docker.io/valkey/valkey:8.1.3 + restart: unless-stopped + command: valkey-server --save 60 1 --requirepass ${VALKEY_PASSWORD} + volumes: + - ${APPDATA_PATH}//valkey:/data + ports: + - ${VALKEY_PORT}:6379 + healthcheck: + test: ["CMD-SHELL", "echo 'auth ${VALKEY_PASSWORD}\nping' | valkey-cli | grep PONG"] + interval: 10s + timeout: 5s + retries: 3 + start_period: 10s