Skip to content
/ postgres_docker Public template

Template repository for deploying PostgreSQL and pgAdmin using Docker-compose.

License

Notifications You must be signed in to change notification settings

cheesecat47/postgres_docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postgres_docker

Template repository for deploying PostgreSQL and pgAdmin using Docker-compose.

 

Prerequisites

Name Version Link
Docker ^20.10.5 https://docs.docker.com/engine/install/
Docker-compose ^1.28.5 https://docs.docker.com/compose/install/

 

How to Use

  1. Clone this repository.

    $ git clone https://github.com/cheesecat47/postgres_docker.git
    $ cd postgres_docker
  2. Run config-generate.sh.

    $ ./config-generate.sh
     # example
     # Input PostgreSQL password >> password
     # Input pgAdmin e-mail >> cheesecat47@gmail.com
     # Input pgAdmin password >> password
     # Done!
  3. Run pg-manage.sh

    $ ./pg-manage.sh -up
    $ ./pg-manage.sh -down

Go to http://localhost:54330 to manage the DB.

For more information, visit Here.

 

Services

Name Version Link
PostgreSQL 13.2 https://hub.docker.com/_/postgres
pgAdmin4 - https://hub.docker.com/r/dpage/pgadmin4/

 

Environment Variables

Service Variable Name Description
PostgreSQL POSTGRES_PASSWORD This is set as superuser pw. The default superuser is defined by the POSTGRES_USER.
pgAdmin4 PGADMIN_DEFAULT_EMAIL It is used when setting up the initial admin account to login.
pgAdmin4 PGADMIN_DEFAULT_PASSWORD It is used when setting up the initial admin account to login.

 

Deploy Ports

Name Port #
postgres 54320
pgadmin 54330

 

About sql directory

Docker runs the *.sql, *.sql.gz and *.sh files in the /docker-entrypoint-initdb.d/ folder once when the container is launched for the first time. Therefore, you can create initialization code, put that file or folder in the /docker-entrypoint-initdb.d/ folder inside the container to initialize it as you wish.

About

Template repository for deploying PostgreSQL and pgAdmin using Docker-compose.

Resources

License

Stars

Watchers

Forks

Languages