Skip to content

tsamaya/docker-compose-postgis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PostgreSQL/PostGIS & pgAdmin with docker-compose

Requirements:

  • docker >= 18.02.0+

Quick Start

  • 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.

Environment variables

The docker-compose file has the following environment variables:

  • POSTGRES_USER the default value is postgres
  • POSTGRES_PASSWORD the default value is SuperSecret
  • PGADMIN_DEFAULT_EMAIL the default value is pgadmin@pgadmin.org
  • PGADMIN_DEFAULT_PASSWORD the default value is SuperSecret
  • PGADMIN_LISTEN_PORT the default value is 49152

Usage

Access to pgAdmin:

  • URL: http://localhost:49152 (by default)
  • Username: pgadmin@pgadmin.org (by default)
  • Password: SuperSecret (by default)

Configure postgres within pgAdmin:

  • Host name/address postgres
  • Port 5432
  • Maintenance database postgres
  • Username as POSTGRES_USER, by default: postgres
  • Password as POSTGRES_PASSWORD, by default SuperSecret

postgis container acess

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=#

Shutdown

  • run $ docker-compose down from the directory hosting the docker-compose file

More

For more detailed instructions about how to start and control your Postgres container, see the documentation for the postgres image here.

Resources

License

Licensed under the MIT License

A copy of the license is available in the repository's LICENSE file.

About

PostgreSQL/PostGIS & pgAdmin with docker-compose

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published