Add GeoServer version to docker-compose yaml

pull/1/head
Nils Bühner 2020-12-17 22:59:50 +01:00
parent 5391f2cb4f
commit 7dbb9d5ae0
3 changed files with 7 additions and 6 deletions

View File

@ -1,9 +1,9 @@
FROM tomcat:jdk11-openjdk-slim
ARG GS_VERSION=2.18.1
ARG GEOSERVER_VERSION=2.18.1
ARG WAR_URL=https://downloads.sourceforge.net/project/geoserver/GeoServer/${GS_VERSION}/geoserver-${GS_VERSION}-war.zip
ARG STABLE_PLUGIN_URL=https://sourceforge.net/projects/geoserver/files/GeoServer/${GS_VERSION}/extensions
ARG WAR_URL=https://downloads.sourceforge.net/project/geoserver/GeoServer/${GEOSERVER_VERSION}/geoserver-${GEOSERVER_VERSION}-war.zip
ARG STABLE_PLUGIN_URL=https://sourceforge.net/projects/geoserver/files/GeoServer/${GEOSERVER_VERSION}/extensions
ARG CORS_ENABLED=false
ARG CORS_ALLOWED_ORIGINS=*
@ -11,7 +11,7 @@ ARG CORS_ALLOWED_METHODS=GET,POST,PUT,DELETE,HEAD,OPTIONS
ARG CORS_ALLOWED_HEADERS=*
# environment variables
ENV GS_VERSION=${GS_VERSION} \
ENV GEOSERVER_VERSION=${GEOSERVER_VERSION} \
GEOSERVER_DIR=${CATALINA_HOME}/webapps/geoserver \
STABLE_PLUGIN_URL=${STABLE_PLUGIN_URL} \
INITIAL_MEMORY=2G \

View File

@ -4,6 +4,7 @@ services:
build:
context: .
args:
- GEOSERVER_VERSION=2.18.1
- CORS_ENABLED=true
- CORS_ALLOWED_METHODS=GET,POST,PUT,HEAD,OPTIONS
ports:

View File

@ -4,7 +4,7 @@
function download_extension() {
URL=$1
EXTENSION=$2
DOWNLOAD_FILE="${ADDITIONAL_LIBS_DIR}geoserver-${GS_VERSION}-${EXTENSION}-plugin.zip"
DOWNLOAD_FILE="${ADDITIONAL_LIBS_DIR}geoserver-${GEOSERVER_VERSION}-${EXTENSION}-plugin.zip"
if [ -e "$DOWNLOAD_FILE" ]; then
echo "$DOWNLOAD_FILE already exists. Skipping download."
@ -22,7 +22,7 @@ function download_extension() {
if [ "$DOWNLOAD_EXTENSIONS" = "true" ]; then
echo "Starting download of extensions"
for EXTENSION in $(echo "${STABLE_EXTENSIONS}" | tr ',' ' '); do
URL="${STABLE_PLUGIN_URL}/geoserver-${GS_VERSION}-${EXTENSION}-plugin.zip"
URL="${STABLE_PLUGIN_URL}/geoserver-${GEOSERVER_VERSION}-${EXTENSION}-plugin.zip"
download_extension ${URL} ${EXTENSION}
done
echo "Finished download of extensions"