Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Optimise docker build #85

Open
wants to merge 4 commits into
base: 2.20.4
Choose a base branch
from
Open
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
42 changes: 24 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ RUN cd /usr/local/tomcat/webapps \
&& rm geoserver.war \
&& mkdir -p $GEOSERVER_DATA_DIR

#
# Install script requirements
#
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y python3 python3-pip python3-dev \
&& pip install pip==9.0.3 \
&& mkdir -p /usr/local/tomcat/tmp
COPY requirements.txt /usr/local/tomcat/tmp
RUN pip install -r /usr/local/tomcat/tmp/requirements.txt

VOLUME $GEOSERVER_DATA_DIR

###########docker host###############
Expand Down Expand Up @@ -63,26 +74,21 @@ RUN echo -n #2===>PUBLIC_PORT=${PUBLIC_PORT}
RUN echo export NGINX_BASE_URL=http://${NGINX_HOST}:${NGINX_PORT}/ | \
sed 's/tcp:\/\/\([^:]*\).*/\1/' >> /root/.bashrc

# copy the script and perform the run of scripts from entrypoint.sh
RUN mkdir -p /usr/local/tomcat/tmp
# copy the scripts and set executable permission
WORKDIR /usr/local/tomcat/tmp
COPY set_geoserver_auth.sh /usr/local/tomcat/tmp
COPY setup_auth.sh /usr/local/tomcat/tmp
COPY requirements.txt /usr/local/tomcat/tmp
COPY get_dockerhost_ip.py /usr/local/tomcat/tmp
COPY get_nginxhost_ip.py /usr/local/tomcat/tmp
COPY entrypoint.sh /usr/local/tomcat/tmp
COPY set_geoserver_auth.sh \
setup_auth.sh \
get_dockerhost_ip.py \
get_nginxhost_ip.py \
entrypoint.sh \
/usr/local/tomcat/tmp/

RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y python3 python3-pip python3-dev \
&& chmod +x /usr/local/tomcat/tmp/set_geoserver_auth.sh \
&& chmod +x /usr/local/tomcat/tmp/setup_auth.sh \
&& chmod +x /usr/local/tomcat/tmp/entrypoint.sh \
&& pip install pip==9.0.3 \
&& pip install -r requirements.txt \
&& chmod +x /usr/local/tomcat/tmp/get_dockerhost_ip.py \
&& chmod +x /usr/local/tomcat/tmp/get_nginxhost_ip.py
RUN chmod +x \
set_geoserver_auth.sh \
setup_auth.sh \
get_dockerhost_ip.py \
get_nginxhost_ip.py \
entrypoint.sh

ENV JAVA_OPTS="-Djava.awt.headless=true -XX:MaxPermSize=512m -XX:PermSize=256m -Xms512m -Xmx2048m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -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 -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL=http://geoserver:8080/geoserver/pdf"

Expand Down