Run the build
docker build -t geodock:1.0 ./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_passwordSubstituting 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.0Point your browser to http://localhost:8080/geoserver/web and you should see the Geoserver welcome page
docker exec -t -i geodock /bin/bashdocker stop geodock
docker system prune -aoc new-app --name=invasivesbci-geoserver-dev \
--env-file=.env/dev.sh https://github.com/bcgov/geodock.git
oc expose svc/invasivesbci-geoserver-devoc get all --selector app=invasivesbci-geoserver-dev
# If everything found can be deleted
oc delete all --selector app=invasivesbci-geoserver-devThe 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
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/"