Public | Automated Build

Last pushed: 2 years ago
Short Description
PostgreSQL with PostGIS
Full Description

These are based on the official postgres Docker images from https://hub.docker.com/_/postgres/. I modified the scripts so that they would install the postgres-postgis packages instead of the vanilla postgres packages.

Usage

In order to use these images, create a Dockerfile with contents similar to the following:

FROM ceagan/postgres-postgis:9.4-2.1
ENV POSTGRES_PASSWORD secret
ADD myDatabase.sql /docker-entrypoint-initdb.d/
EXPOSE 5432

Your myDatabase.sql file should resemble the following:

--- Create Application user
CREATE USER myUser WITH PASSWORD 'secret';
--- Create Application database
CREATE DATABASE myDatabase OWNER myUser;
--- Grant Application user access to the Application database
GRANT ALL PRIVILEGES ON DATABASE myDatabase to myUser;
--- Switch to the Application database
\c myDatabase
-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
-- Enable Topology
CREATE EXTENSION postgis_topology;
-- fuzzy matching needed for Tiger
CREATE EXTENSION fuzzystrmatch;
-- Enable US Tiger Geocoder
CREATE EXTENSION postgis_tiger_geocoder;
Docker Pull Command
Owner
ceagan
Source Repository

Comments (0)