Skip to content

daveism/docker-postgis-pgrouting

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 

Repository files navigation

Dockerfile PostGIS PGrouting

Info

This Dockerfile creates a container running PostGIS 2.1/PGRouting in PostgreSQL 9.1

  • expose port 5432
  • initializes a database in /var/lib/postgresql/9.1/main
  • superuser in the database: docker/docker

Install

  • docker build -t postgis:2.1 . or docker build -t postgis:2.1 github.com/daveism/docker-postgis-pgrouting
  • docker run -d postgis:2.1

Usage

To connect to database, use docker inspect CONTAINER and grep IPAddress, e.g.

CONTAINER=$(sudo docker run -d -t daveism/docker-postgis-pgrouting)
CONTAINER_IP=$(sudo docker inspect $CONTAINER | grep IPAddress | awk '{ print $2 }' | tr -d ',"')
psql -h $CONTAINER_IP -p 5432 -U docker -W postgres

Persistance

You can mount the database directory as a volume to persist your data:

docker run -d -v $HOME/postgres_data:/var/lib/postgresql postgis:2.1

Makes sure first need to create source folder: mkdir -p ~HOME/postgres_data.

If you copy existing postgresql data, you need to set permission properly (chown/chgrp)

Meta

Build width docker version 0.7.0

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%