Skip to content

[Fixes #57] Move datadir management to the Geoserver image #58

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions docker/geoserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,30 @@ ENV GEOSERVER_CORS_ENABLED=$GEOSERVER_CORS_ENABLED
ENV GEOSERVER_CORS_ALLOWED_ORIGINS=$GEOSERVER_CORS_ALLOWED_ORIGINS
ENV GEOSERVER_CORS_ALLOWED_METHODS=$GEOSERVER_CORS_ALLOWED_METHODS
ENV GEOSERVER_CORS_ALLOWED_HEADERS=$GEOSERVER_CORS_ALLOWED_HEADERS


RUN apt-get update -y && apt-get install curl wget unzip -y
RUN apt-get install -y procps less && \
apt-get install -y python3 python3-pip python3-dev

RUN pip install j2cli invoke==2.2.0 requests==2.31.0

#
# Download and install GeoServer
#
RUN apt-get update -y && apt-get install curl wget unzip -y
RUN cd /usr/local/tomcat/webapps \
&& wget --no-check-certificate --progress=bar:force:noscroll https://artifacts.geonode.org/geoserver/${GEOSERVER_VERSION}/geoserver.war -O geoserver.war \
&& unzip -q geoserver.war -d geoserver \
&& rm geoserver.war \
&& mkdir -p $GEOSERVER_DATA_DIR
&& rm geoserver.war

VOLUME $GEOSERVER_DATA_DIR
#
# Download datadir
#
RUN mkdir -p /tmp/geonode/downloaded
WORKDIR /tmp/geonode/downloaded
ENV TEMP_DOWNLOADED /tmp/geonode/downloaded
RUN wget --no-check-certificate --progress=bar:force:noscroll https://artifacts.geonode.org/geoserver/$GEOSERVER_VERSION/geonode-geoserver-ext-web-app-data.zip -O data.zip \
&& unzip -x data

# no longer used since 2.24.2
#ENV GEOSERVER_LIB_DIR="/usr/local/tomcat/webapps/geoserver/WEB-INF/lib"
Expand All @@ -54,11 +67,6 @@ RUN chmod +x \
/usr/local/tomcat/tmp/set_geoserver_auth.sh \
/usr/local/tomcat/tmp/entrypoint.sh

RUN apt-get install -y procps less && \
apt-get install -y python3 python3-pip python3-dev

RUN pip install j2cli invoke==2.2.0 requests==2.31.0

ENV JAVA_OPTS="-Djava.awt.headless=true -Dgwc.context.suffix=gwc -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -XX:MaxPermSize=512m -XX:PermSize=256m -Xms512m -Xmx2048m -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=false -DGS-SHAPEFILE-CHARSET=UTF-8 -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL=http://geoserver:8080/geoserver/pdf -Xbootclasspath/a:/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/marlin-0.9.3.jar -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine"

CMD ["/usr/local/tomcat/tmp/entrypoint.sh"]
10 changes: 10 additions & 0 deletions docker/geoserver/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ invoke () {
echo "$@ tasks done"
}


mkdir -p $GEOSERVER_DATA_DIR
if [ -z "$( ls -A ${GEOSERVER_DATA_DIR} )" ];
then
echo "${GEOSERVER_DATA_DIR} is empty. It will be populated with the default datadir content"
cp -r ${TEMP_DOWNLOADED}/data/* ${GEOSERVER_DATA_DIR}
else
echo "${GEOSERVER_DATA_DIR} is already populated. It won't be touched"
fi

# control the values of LB settings if present
if [ -n "$GEONODE_LB_HOST_IP" ];
then
Expand Down
26 changes: 0 additions & 26 deletions docker/geoserver_data/Dockerfile

This file was deleted.

208 changes: 0 additions & 208 deletions docker/geoserver_data/README.rst

This file was deleted.

14 changes: 0 additions & 14 deletions docker/geoserver_data/docker-compose.yml

This file was deleted.

18 changes: 0 additions & 18 deletions docker/geoserver_data/download.sh

This file was deleted.