Giter Club home page Giter Club logo

geoserver's Introduction

Geoserver in Docker with Tomcat and Oracle JRE

Use this repo to build a small footprint docker image containing the following based on alpine linux:

  • Tomcat (versions tested compatible with Geoserver)
  • Oracle JDK 8
  • su-exec
  • dockerize

To enable strong cryptography in Oracle JRE, the image contains local_policy.jar and US_export_policy.jar extracted from http://download.oracle.com/otn-pub/java/jce/7/UnlimitedJCEPolicyJDK7.zip

The Dockerfile is adapted from the following primarily because Oracle JDK 7 is no longer available

su-exec has been included so that tomcat would run as non-root user for better security. The docker image uses /docker-entrypoint.sh to run tomcat as non-root user. The numeric UID of this user in the container defaults to 1000 but it may be overridden with the environment variable TOMCAT_UID.

dockerize may be used to wait for any dependent container (service) to be ready before starting Tomcat. To use it, define the environment variable DOCKERIZE_CMD with the full command, e.g. dockerize -wait=tcp://my_postgresql_host_ip:5432 -timeout=30m.

Even though GeoServer has only been officially tested with JRE7, it seems to work fine with JRE8.

Usage

Tomcat webapps directory in the container is /usr/tomcat/webapps/

Override any JRE JAVA default values using environment in docker-compose.yml file. GeoServer requires MINMEM greater or equal to 64 MB.

A complete sample docker-compose.yml may look like this:

geoserver:
  image: cheewai/tomcat
  environment:
    - TOMCAT_UID=1001
    - MAXMEM=2g
    - GEOSERVER_DATA_DIR=/var/geoserver
    - GEOSERVER_LOG_LOCATION=/logs/geoserver.log
  volumes:
    - ./gsdata:/var/geoserver
    - ./logs:/logs
  ports:
    - "8080:8080"

Recommended Resource Limits

When Geoserver starts up, its CPU and RAM usage spikes. If you don't provide enough, it will take a long time to be ready, if at all.

Using docker-compose.yml version 3 for docker stack deploy:

    deploy:
      resources:
        limits:
          cpus: '4.0'
          memory: 3g

Using docker-compose.yml version 2.2 for docker-compose:

    cpus: 4
    mem_limit: 3g

CAVEAT

  • If you include community plugin geofence and leave it unconfigured, Geoserver will malfunction

geoserver's People

Contributors

cynici avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.