Running the Image
Running the Image
Run (automated using docker-compose)
Note: You probably want to use docker-compose for running as it will provide a repeatable orchestrated deployment system.
We provide a sample docker-compose.yml
file that illustrates
how you can establish a GeoServer + PostGIS.
If you are interested in the backups , add a section in the docker-compose.yml
following instructions from docker-pg-backup.
If you start the stack using the compose file make sure you log in into GeoServer using username:admin
and password:myawesomegeoserver
.
Note The username and password are specified in the .env
file. It is recommended
to change them into something more secure otherwise a strong password is generated.
Please read the docker-compose
documentation for details on usage and syntax of docker-compose
- it is
not covered here.
Once all the services start, test by visiting the GeoServer landing page in your browser: http://localhost:8600/geoserver.
To run in the background rather, press ctrl-c
to stop the
containers and run again in the background:
docker-compose up -d
Note: The docker-compose.yml
uses host-based volumes so
when you remove the containers, all data will be kept. Using host-based volumes ensures that your data persists
between invocations of the compose file. If you need to delete the container data you need to run docker-compose down -v
.
Reverse Proxy using NGINX
You can also put Nginx in front of GeoServer to receive the http request and translate it to uwsgi.
A sample docker-compose-nginx.yml
is provided for running GeoServer and Nginx
docker-compose -f docker-compose-nginx.yml up -d
Once the services are running GeoServer will be available from
http://localhost/geoserver/web/
Additional Notes for MacOS M1 Chip
To run the docker image with MacOS M1 Chip, the image needs to be built locally.
- JDK version of “9-jdk17-openjdk-slim-buster “ can work with M1 Chip as it is instructed on "Local build using repository checkout" section, the parameters below needs to be changed in .env file and Dockerfile
IMAGE_VERSION=9-jdk17-openjdk-slim-buster
JAVA_HOME=/usr/local/openjdk-17
- The change above also requires the removal of some command-line options in
entrypoint.sh file.
(Since they generate
Unrecognized VM option 'CMSClassUnloadingEnabled'
error and these options are related to JDK10 and lower)
-XX:+CMSClassUnloadingEnabled
-XX:+UseG1GC
After these changes, the image can be built as instructed.
To run the just-built local image with your docker-compose file, the platform option in the docker-compose file
needs to be specified as linux/arm64/v8
. Otherwise, it will try to pull the docker image from the docker hub
instead of using the local image.
Reverse Proxy using NGINX
You can also put nginx in front of geoserver to receive http request and translate it to uwsgi.
A sample docker-compose-nginx.yml
is provided for running geoserver and nginx
docker-compose -f docker-compose-nginx.yml up -d
Once the services are running GeoServer will be available from
http://localhost/geoserver/web/