diff --git a/template/apps/pgadmin.json b/template/apps/pgadmin.json index d42eb02..7d8f2c6 100644 --- a/template/apps/pgadmin.json +++ b/template/apps/pgadmin.json @@ -35,6 +35,7 @@ "image_arm64": "dpage/pgadmin4:latest", "image_amd64": "dpage/pgadmin4:latest", "logo": "https://raw.githubusercontent.com/pi-hosted/pi-hosted/master/images/pgadmin.png", + "preInstallScript": "install_pgadmin.sh", "name": "pgadmin", "platform": "linux", "ports": [ @@ -45,7 +46,7 @@ "type": 1, "volumes": [ { - "bind": "/portainer/Files/AppData/Config/pgAdmin", + "bind": "/portainer/Files/AppData/Config/pgadmin", "container": "/var/lib/pgadmin" } ], diff --git a/tools/install_pgadmin.sh b/tools/install_pgadmin.sh new file mode 100755 index 0000000..137c903 --- /dev/null +++ b/tools/install_pgadmin.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +function error { + echo -e "\\e[91m$1\\e[39m" + exit 1 +} + +echo "Creating directory..." +sudo mkdir -p /portainer/Files/AppData/Config/pgadmin || error "Failed to create pgadmin folder!" +sudo mkdir -p /portainer/Files/AppData/Config/pgadmin || error "Failed to create pgadmin folder!" +sudo chown -R 5050:root /portainer/Files/AppData/Config/pgadmin || error "Failed to create pgadmin folder!" +echo "Setup complete. You can now install the PgAdmin using the App Template."