- docker >= 18.02.0+
- clone this repository
$ cd path/to/cloned/repo/
- run
docker-compose up -d
PGDATA
is mounted locally in volumes/pgdata and contains the database files.
pgadmin
is mounted locally in volumes/pgadmin and contains the pgadmin session configuration files.
The docker-compose file has the following environment variables:
POSTGRES_USER
the default value is postgresPOSTGRES_PASSWORD
the default value is SuperSecretPGADMIN_DEFAULT_EMAIL
the default value is pgadmin@pgadmin.orgPGADMIN_DEFAULT_PASSWORD
the default value is SuperSecretPGADMIN_LISTEN_PORT
the default value is 49152
- URL:
http://localhost:49152
(by default) - Username:
pgadmin@pgadmin.org
(by default) - Password:
SuperSecret
(by default)
- Host name/address
postgres
- Port
5432
- Maintenance database
postgres
- Username as
POSTGRES_USER
, by default:postgres
- Password as
POSTGRES_PASSWORD
, by defaultSuperSecret
Once you have started a database container, you can then connect to the database as follows:
- run
$ docker exec -ti postgres_container /bin/bash
then the usual psql
, pg_restore
comands are available, for instance:
root@c01fb351f02c:/# psql -U postgres
psql (12.2 (Debian 12.2-2.pgdg100+1))
Type "help" for help.
postgres=#
- run
$ docker-compose down
from the directory hosting the docker-compose file
For more detailed instructions about how to start and control your Postgres container, see the documentation for the postgres image here.
- docker image postgis : https://registry.hub.docker.com/r/postgis/postgis
- docker image for postgres : https://registry.hub.docker.com/_/postgres/
- additional pgAdmin configuration : https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html
Licensed under the MIT License
A copy of the license is available in the repository's LICENSE file.