Add postgres and adminer as container to pod kontor

refs #37

(cherry picked from commit 4469010a74ffefe2d92ffa335d7d1225d12fdece)
This commit is contained in:
2026-01-28 01:22:54 +01:00
committed by Thomas Peetz
parent b1127130cd
commit aff1720972
3 changed files with 47 additions and 0 deletions
+3
View File
@@ -7,6 +7,9 @@ set -e
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
if command -v podman &> /dev/null; then if command -v podman &> /dev/null; then
echo "podman is installed"
else
echo "update repositories and install podman"
sudo apt-get update &> /dev/null sudo apt-get update &> /dev/null
sudo apt-get install podman sudo apt-get install podman
fi fi
+35
View File
@@ -11,12 +11,47 @@ script/bootstrap
echo "==> Setting up pod kontor" echo "==> Setting up pod kontor"
if podman pod exists kontor; then if podman pod exists kontor; then
echo " => pod kontor exists" echo " => pod kontor exists"
if podman pod ps --filter "name=kontor" --filter "status=running"; then
echo " => pod kontor is running"
else
podman pod start kontor
fi
else else
podman pod create --name kontor \ podman pod create --name kontor \
--infra \ --infra \
-p 5432:5432 \ -p 5432:5432 \
-p 8100:8100 \ -p 8100:8100 \
-p 8200:8200 \ -p 8200:8200 \
-p 8900:8080 \
--network bridge --network bridge
fi fi
echo "==> Setting up volume kontor-db"
if podman volume exists kontor-db; then
echo " => volume kontor-db exists"
else
podman volume create kontor-db
fi
echo "==> Setting up container postgres"
if podman container exists postgres; then
if podman ps -q --filter "name=postgres"; then
echo " => postgres is running"
fi
else
podman run -d --replace --pod kontor --name postgres \
-e POSTGRES_PASSWORD=kontor \
-e POSTGRES_DB=kontor \
-e POSTGRES_USER=kontor \
-v kontor-db:/var/lib/postgresql/data \
postgres:17
fi
echo "==> Setting up container adminer"
if podman container exists adminer; then
if podman ps -q --filter "name=adminer"; then
echo " => adminer is running"
fi
else
podman run -d --replace --pod kontor --name adminer adminer
fi
+9
View File
@@ -6,3 +6,12 @@ set -e
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
echo "==> Stopping and removing pod kontor"
if podman pod exists kontor; then
podman pod stop kontor
podman pod rm kontor
podman rm postgres
podman rm adminer
fi
script/setup