Skip to content

Adrian-Hirt/dmdb_psql

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

DMDB pgAdmin & PostgreSQL for Docker

docker-compose.yml modified from khezen/compose-postgres.

Setup

  1. Install Docker and Docker-Compose
  2. Download the docker-compose.yml file
  3. run docker volume create pgdata and docker volume create pgadmin to create the volumes

Using

  1. Open the command-line and navigate to the directory where you have the docker-compose.yml file
  2. run docker-compose up -d to start the app
  3. Go to localhost:5050 with your favourite browser.
  4. log-in with E-Mail dmdb@example.com and Password admin Step 1
  5. On the dashboard, click on Add New Server Step 2
  6. Give the server any name, and go to the Connection tab. As the hostname, use postgres, username and role are postgres as well, and the password is password. Click on Save to connect to the server. Step 3
  7. Navigate to the database you just created and click on Tools in the navbar and then on Query Tool. Step 4
  8. Now you can use the SQL prompt window! Step 5

Stopping the application

To stop the application, just enter docker-compose down in the terminal, when you are in the folder with the docker-compose.yml file.

Restarting again

Just follow the steps in the Using chapter to use the app to any later point again. Thanks to the docker volumes, the databases will be persistens even when you shut down Postgres.

Removing the containers

If you want to remove the containers, stop the application and use docker container prune and confirm to remove the containers.

Removing the image

Use docker images to list all images, and docker rmi IMAGE_ID where IMAGE ID is the id of the image (fenglc/pgadmin4) from the list command.

Removing the volumes

Use docker volume remove pgdata and docker volume remove pgadmin to remove the volumes