Skip to content

Instantly share code, notes, and snippets.

@pdkovacs
Created March 10, 2023 16:24
Show Gist options
  • Save pdkovacs/a0988f6659454534e234fd1df50fa5dd to your computer and use it in GitHub Desktop.
Save pdkovacs/a0988f6659454534e234fd1df50fa5dd to your computer and use it in GitHub Desktop.
Start pgadmin4 in docker container
#!/bin/bash
# https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html
container_name=pg-admin
email=admin@otter.com
password=password
if docker ps -a | grep $container_name;
then
docker start $container_name
else
docker pull dpage/pgadmin4
docker run --name $container_name \
-p 9991:80 \
-e "PGADMIN_LISTEN_ADDRESS=0.0.0.0" \
-e "PGADMIN_DEFAULT_EMAIL=$email" \
-e "PGADMIN_DEFAULT_PASSWORD=$password" \
-d dpage/pgadmin4
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment