Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ops 1263 #1

Closed
wants to merge 12 commits into from
14 changes: 0 additions & 14 deletions 01_geoserver.sh

This file was deleted.

42 changes: 25 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
FROM neowaylabs/java8:latest
FROM docker.osgeo.org/geoserver:2.23.1

MAINTAINER Rodrigo Zanato Tripodi <[email protected]>
#
# Set GeoServer version and data directory
#
ARG GEOSERVER_VERSION=2.23
ARG PATCH_NUMBER=1
ARG CORS_ENABLED=true
ARG CORS_ALLOWED_METHODS=GET,POST,PUT,HEAD,OPTIONS
ENV GEOSERVER_DATA_DIR="/geoserver_data"

EXPOSE 8080
#
# Download and install GeoServer
#
RUN apt update && \
apt upgrade -y && \
apt install unzip

ENV JAVA_OPTS -Xms128m -Xmx512m -XX:MaxPermSize=512m
ENV ADMIN_PASSWD geoserver
# Download the backup/restore plugin
RUN mkdir geoserver-backup-plugin && cd geoserver-backup-plugin && \
wget -c https://build.geoserver.org/geoserver/${GEOSERVER_VERSION}.x/community-latest/geoserver-${GEOSERVER_VERSION}-SNAPSHOT-backup-restore-plugin.zip && \
unzip geoserver-${GEOSERVER_VERSION}-SNAPSHOT-backup-restore-plugin.zip && \
rm geoserver-${GEOSERVER_VERSION}-SNAPSHOT-backup-restore-plugin.zip

RUN apt-get install -qqy unzip && \
wget -c http://downloads.sourceforge.net/project/geoserver/GeoServer/2.6.1/geoserver-2.6.1-bin.zip \
-O /tmp/geoserver-2.6.1-bin.zip && \
unzip /tmp/geoserver-2.6.1-bin.zip -d /opt && \
cd /opt && \
ln -s geoserver-2.6.1 geoserver
# Place the backup/restore plugin to be installed on startup
RUN mkdir /opt/additional_libs && \
cp geoserver-backup-plugin/* /opt/additional_libs/ && \
rm -rf geoserver-backup-plugin

ADD 01_geoserver.sh /etc/my_init.d/01_geoserver.sh
RUN chmod +x /etc/my_init.d/01_geoserver.sh
ENV JAVA_OPTS="-Djavax.servlet.response.encoding=UTF-8 -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=true"

CMD ["/sbin/my_init"]

RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
IMAGENAME = neowaylabs/geoserver

all: build
IMAGENAME = navenio-docker.jfrog.io/geoserver/geoserver_2_14:${TAG}

build:
docker build -t $(IMAGENAME) .
Expand All @@ -10,3 +8,9 @@ clean:

test:
docker run --rm -t -i -p 8080:8080 $(IMAGENAME)

test_volume:
docker run --rm -t -i -p 8080:8080 -v ${LOCAL_DATA_DIR}:/geoserver_data/data $(IMAGENAME)

push:
docker push $(IMAGENAME)
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@

[Geoserver](http://geoserver.org/) docker

## Environment settings:
## Environment settings

* JAVA_OPTS (default: -Xms128m -Xmx512m -XX:MaxPermSize=512m)
* ADMIN_PASSWD (default: geoserver)

## Exposed TCP ports:
## Exposed TCP ports

* 8080: REST and Admin interface
* 80: REST and Admin interface

## Internal volumes:
## Internal volumes

* /opt/geoserver/data_dir: default application data directory
* /opt/geoserver/data_dir/styles: styles (sld, xml, images) directory
* /geoserver_data: default application data directory

## Plugins installed

* backup/restore

## Docker compose

* Download data directory (e.g. kubectl -n geoserver-prod cp geoserver-prod/geoserver-prod-0:/geoserver_data/data .). Run via docker-compose -f docker-compose.yaml up --build
* You can then find the geoserver at localhost/geoserver/
21 changes: 21 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '1'
services:
geoserver:
build:
context: .
args:
- GEOSERVER_VERSION=2.23
- CORS_ENABLED=true
- CORS_ALLOWED_METHODS=GET,POST,PUT,HEAD,OPTIONS
ports:
- 80:8080
environment:
- INSTALL_EXTENSIONS=true
- STABLE_EXTENSIONS=wps,csw
- EXTRA_JAVA_OPTS=-Xms1G -Xmx2G
- SKIP_DEMO_DATA=true
- ROOT_WEBAPP_REDIRECT=true
- GEOSERVER_REQUIRE_FILE=/geoserver_data/global.xml
- GEOSERVER_DATA_DIR=/geoserver_data
volumes:
- ./data:/geoserver_data/:Z