Skip to content

bcgov/geodock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Geoserver Docker Image

Building

Run the build

docker build -t geodock:1.0 ./

Running

Geoserver comes with an admin account, password geoserver. You can change this automatically by creating a file .env/local.sh and putting in the following:

ADMIN_PASS=new_password

Substituting new_password for your new password.

Then run docker like this:

docker run -d -p 8080:8080 --name geodock --net=host \
  --env-file .env/local.sh geodock:1.0

Point your browser to http://localhost:8080/geoserver/web and you should see the Geoserver welcome page

Logging into the container

docker exec -t -i geodock /bin/bash

Stopping and cleaning up

docker stop geodock
docker system prune -a

Running in OpenShift

oc new-app --name=invasivesbci-geoserver-dev \
--env-file=.env/dev.sh https://github.com/bcgov/geodock.git
oc expose svc/invasivesbci-geoserver-dev

Cleaning up Openshift

oc get all --selector app=invasivesbci-geoserver-dev
# If everything found can be deleted
oc delete all --selector app=invasivesbci-geoserver-dev

Configuring

The general workflow is as follows:

  • Use the Geoserver GUI to configure and add services.
  • Use the API to extract the JSON representation of the configuration.
  • Save this JSON in the /JSON directory
  • Add a command within the config script that sends this JSON to the API on POD initiation

Example Configuration Workflow

Request to harvest the JSON for a Layer:

curl \
  --header 'Content-Type: application/json' \
  -L "http://admin:$ADMIN_PASS@localhost:8080/geoserver/rest/workspaces/invasives/datastores/Invasives/featuretypes/aggregate_tenures.json"

Save the output in json/create-aggregate-layer.json then use the following command, or put it in the config.sh file as follows:

curl -X POST \
  --header 'Content-Type: application/json' \
  -d "@json/create-aggregate-layer.json" \
  -L "http://admin:$ADMIN_PASS@localhost:8080/geoserver/rest/workspaces/invasives/datastores/Invasives/featuretypes/"

Releases

No releases published

Packages

No packages published

Languages

  • Scheme 80.6%
  • Shell 17.1%
  • Dockerfile 2.3%