From de1330cd9f39d0c733a3f722407289a352cae6e2 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 4 Aug 2025 18:27:04 +0200 Subject: [PATCH] Add standalone script for setting up the docker DBs So we can use it via the new menu system --- bin/omarchy-setup-docker-dbs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 bin/omarchy-setup-docker-dbs diff --git a/bin/omarchy-setup-docker-dbs b/bin/omarchy-setup-docker-dbs new file mode 100755 index 00000000..584f1624 --- /dev/null +++ b/bin/omarchy-setup-docker-dbs @@ -0,0 +1,21 @@ +#!/bin/bash + +# Show logo +clear +cat <~/.local/share/omarchy/logo.txt + +options=("MariaDB" "MySQL" "Redis" "PostgreSQL") +choices=$(printf "%s\n" "${options[@]}" | gum choose --no-limit --header "Select databases (space to select, return to install, esc to cancel)") || main_menu + +if [[ -n "$choices" ]]; then + for db in $choices; do + case $db in + MySQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mysql8 -e MYSQL_ROOT_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql:8.4 ;; + PostgreSQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:5432:5432" --name=postgres16 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:16 ;; + MariaDB) sudo docker run -d --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mariadb11 -e MARIADB_ROOT_PASSWORD= -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=true mariadb:11.8 ;; + Redis) sudo docker run -d --restart unless-stopped -p "127.0.0.1:6379:6379" --name=redis redis:7 ;; + esac + done +fi + +gum spin --spinner "globe" --title "Done!" -- sleep 2