Skip to content

A GeoServer Docker Image with predefined extensions and CORS support.

Notifications You must be signed in to change notification settings

meggsimum/geoserver-docker

Repository files navigation

GeoServer Docker

A GeoServer Docker Image with predefined extensions and CORS support.

GeoServer is an open source server for sharing geospatial data. Designed for interoperability, it publishes data from any major spatial data source using open standards.

Run as container

By running

docker run -p 8080:8080 meggsimum/geoserver:2.19.3

you'll get a cleaned standard GeoServer (Version 2.19.3), which can be accessed by http://localhost:8080/geoserver

Supported ENV VARs

  • USE_CORS=1 (0/1) Default is 0
  • USE_WPS=1 (0/1) Default is 0
  • USE_VECTOR_TILES=1 (0/1) Default is 0
  • APP_PATH_PREFIX="my#deploy#path#" (any string compliant to Tomcat context path naming )
  • GEOSERVER_ADMIN_USER (String - supported since 2.19.x) Default is admin
  • GEOSERVER_ADMIN_PASSWORD (String - supported since 2.19.x) Default is geoserver
  • UPDATE_CREDENTIALS (0/1) If the credentials shall be updated on startup. Default is 0

For detailed information check the sections below.

Use a Volume

The geoserver_data directory can be mounted as volume on the host system.

docker run -p 8080:8080 -v $(pwd)/geoserver_data:/opt/geoserver_data meggsimum/geoserver

CORS Support

This Docker Image allows to run GeoServer with CORS (Cross-Origin Resource Sharing) support.

In order to enable CORS for your GeoServer container the environment variable USE_CORS can be used.

By running

docker run -e USE_CORS=1 -p 8080:8080 meggsimum/geoserver

you'll get a GeoServer with CORS enabled.

Shipped Extensions

This Docker Image comes with several extensions which are bundled in:

  • WPS
  • Vector Tiles

These extensions can be activated by the following environment variables:

  • USE_WPS=1
  • USE_VECTOR_TILES=1

By running

docker run -e USE_WPS=1 -e USE_VECTOR_TILES=1 -p 8080:8080 meggsimum/geoserver

you'll get a GeoServer with installed and activated WPS and Vector Tiles extension.

Change Deployment Path

This Docker Image allows to deploy GeoServer under a given path instead of always being hosted under /geoserver.

The path is defined in the environment variable APP_PATH_PREFIX in the form foo#bar#, which leads the application being hosted under /foo/bar/geoserver/. If the env var is not set the GeoServer will be hosted under /geoserver as usual.

By running

docker run -e APP_PATH_PREFIX="foo#bar#" -p 8080:8080 meggsimum/geoserver

you'll get the GeoServer deployed at http://localhost:8080/foo/bar/geoserver/.

Change Admin Credentials

In order to have individual admin credentials in your running container the environment variables GEOSERVER_ADMIN_USER and GEOSERVER_ADMIN_PASSWORD can be set:

docker run -e GEOSERVER_ADMIN_USER=peter -e GEOSERVER_ADMIN_PASSWORD=abcd -p 8080:8080 meggsimum/geoserver

Setting UPDATE_CREDENTIALS to 0 does not update the credentials on startup. This is useful if an existing volume shall be mounted that already has credentials set up.

docker run -e UPDATE_CREDENTIALS=0 -v $(pwd)/geoserver_data:/opt/geoserver_data -p 8080:8080 meggsimum/geoserver:latest

Build this Image

cd /path/to/this/repository/
docker build -t {YOUR_TAG} .

Credits

This GeoServer Docker Image was heavily inspired by the one here: https://github.com/terrestris/docker-geoserver/ of the terrestris organization. Thank you!

Also a big thank you to the fabulous GeoServer project and its maintainers / contributors. GeoServer is excellent, you rock!

About

A GeoServer Docker Image with predefined extensions and CORS support.

Resources

Stars

Watchers

Forks

Packages

No packages published