summaryrefslogtreecommitdiff
path: root/scripts/start-db.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/start-db.sh')
-rwxr-xr-xscripts/start-db.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/start-db.sh b/scripts/start-db.sh
new file mode 100755
index 0000000..d46e5f5
--- /dev/null
+++ b/scripts/start-db.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+CONTAINER_NAME="pg-postgres-browser"
+
+if podman ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
+ echo "Container existiert bereits, starte neu..."
+ podman start "${CONTAINER_NAME}"
+else
+ echo "Erstelle neuen Container..."
+ podman run -d --name "${CONTAINER_NAME}" \
+ -e POSTGRES_PASSWORD=test \
+ -e POSTGRES_DB=testdb \
+ -p 5432:5432 \
+ postgres:latest
+fi \ No newline at end of file