From 3a6a1becdfa6e44e1eca40cfa24d16a3024f410d Mon Sep 17 00:00:00 2001 From: leo <426742@gmail.com> Date: Sat, 21 Sep 2024 04:01:05 +0500 Subject: [PATCH] autocommit --- docker-compose.yml | 4 ++-- install.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 install.sh diff --git a/docker-compose.yml b/docker-compose.yml index f0edc16..0a2d59b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,8 @@ services: mariadb: container_name: mariadb - image: mariadb:lts-ubi9 - restart: always + image: mariadb:11.5.2-ubi9 + restart: unless-stopped networks: - proxynet env_file: diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..c895b54 --- /dev/null +++ b/install.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ "$(id -u)" != "0" ]; then + echo -e "\033[31mThis script requires superuser rights.\033[0m" + exit 0 +fi + +trap 'echo -e "\033[31minstall.sh: Something went wrong\033[0m"; exit 1' ERR +set -e + +export DEBIAN_FRONTEND=noninteractive + +echo "Install mariadb..." +cd /data/utils +bash global-env.sh MARIADB_USER admin +bash global-env.sh MARIADB_DB mariadb +sudo bash env-gen.sh MARIADB_ROOT_PASSWORD +MARIADBPASSWORD=$(pwgen -s 20 1); +sudo bash env-gen.sh MARIADB_PASSWORD $MARIADBPASSWORD +sudo bash env-gen.sh WORDPRESS_DB_PASSWORD $MARIADBPASSWORD +sudo bash env-gen.sh WP_ADMIN_PASSWORD +mkdir -p /data/appdata/mariadb +sudo chown -R 1001:1001 /data/appdata/mariadb +cd /data/mariadb +sudo docker compose up -d + +trap - ERR +echo "Install postgres complete" \ No newline at end of file