Created
August 7, 2019 23:49
-
-
Save bernardoduarte/f15ac7bb2c96927c1e8f99e46d0353be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Absolute path to this script, e.g. /home/user/bin/foo.sh | |
SCRIPT=$(readlink -f "$0") | |
# Absolute path this script is in, thus /home/user/bin | |
SCRIPT_PATH=$(dirname "$SCRIPT") | |
default_port="8080" | |
default_server_volume="$SCRIPT_PATH/servers.json" | |
default_email="admin" | |
default_password="admin" | |
port=${1:-${default_port}} | |
server_volume=${2:-${default_server_volume}} | |
email=${3:-${default_email}} | |
password=${4:-${default_password}} | |
echo "Port: $port" | |
echo "Server Volume: $server_volume" | |
echo "Email: $email" | |
echo "Password: $password" | |
docker pull dpage/pgadmin4 | |
docker run -p ${port}:80 \ | |
-v "${server_volume}:/pgadmin4/servers.json" \ | |
-e "PGADMIN_DEFAULT_EMAIL=${email}" \ | |
-e "PGADMIN_DEFAULT_PASSWORD=${password}" \ | |
-d --rm dpage/pgadmin4 | |
echo "Running at http://localhost:$port" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment