GeoServer + PostGIS Docker Image
orlade/docker-geoserver-postgis on Docker Hub
Docker image for an instance of GeoServer with a connection to a remote PostGIS data store.
Builds on the kartoza/geoserver image (GitHub), and provides numerous options
to configure both the PostGIS connection and GeoServer workspace.
Provide the following environment variables at runtime to configure the connection to PostGIS:
PG_HOSTNAME: The hostname of the PostgreSQL database server (e.g.
PG_PORT: The port of the PostgreSQL database server that PostgreSQL is serving on (e.g.
PG_HOST: The hostname and port of the PostgreSQL database server (e.g.
may be provided in place of the individual hostname and port, or vice versa.
PG_USERNAME: The username of the PostgreSQL user used by the app.
PG_PASSWORD: The password of the PostgreSQL user used by the app.
PG_DATABASE: The name of the PostgreSQL database to connect to.
You can optionally provide the following environment variables to configure GeoServer as well:
GEOSERVER_USERNAME: The username for the GeoServer admin user. Defaults to "admin".
GEOSERVER_PASSWORD: The password for the GeoServer admin user. Defaults to "geoserver".
GEOSERVER_WORKSPACE: The workspace to set up for the app. Defaults to
GEOSERVER_NAMESPACE: The namespace to use within the workspace. Defaults to
GEOSERVER_NAMESPACE_ID: The ID of the new namespace. Defaults to
GEOSERVER_DATASTORE: The name of the datastore to create in the workspace. Defaults to
GEOSERVER_STYLENAME: The name of the style to create in the workspace. Defaults to
Note: Creating the style requires that you place a
style.sldfile into the
directory of this repository before building the image. You can get an SLD file in the right
format by uploading a style to a local GeoServer instance and exploring its
data_dir/workspaces/<your_workspace>/stylesdirectory. To keep this file private, fork this
repository into a private repository, commit your own style file and rebuild with Docker.
GEOSERVER_HOME is defined by the parent image (kartoza/geoserver) as the location in
which GeoServer is installed (
Note: The PostgreSQL and GeoServer passwords will be stored in plain text within the container.