Last active
February 27, 2025 17:30
-
-
Save breiter/30fc9ac1263df84b164d568c267034e3 to your computer and use it in GitHub Desktop.
pgadmin4 local docker
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 | |
# change to your email | |
[email protected] | |
PASSWORD=password | |
# note that the hostname of postgres database running on the same docker host is | |
# host.docker.internal | |
docker run --rm --pull always \ | |
-e "PGADMIN_DEFAULT_EMAIL=${EMAIL}" \ | |
-e "PGADMIN_DEFAULT_PASSWORD=${PASSWORD}" \ | |
-p 5050:80 \ | |
--name pgadmin4 \ | |
--volume pgadmin4-vol:/var/lib/pgadmin \ | |
--detach dpage/pgadmin4 \ | |
|| exit | |
until curl --output /dev/null --silent --head --fail http://localhost:5050; do | |
printf '.' | |
sleep 1 | |
done | |
printf "\npgadmin4 is listening on http://localhost:5050/\nstarting browser\n" | |
OPEN="" | |
case $(uname -s) in | |
Linux*) | |
OPEN=xdg-open | |
;; | |
Darwin*) | |
OPEN=open | |
;; | |
*) | |
OPEN=start #assume windows | |
;; | |
esac | |
$OPEN http://localhost:5050/ |
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 | |
docker stop pgadmin4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment