forked from kartoza/docker-geoserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·148 lines (122 loc) · 4.97 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#--------- Generic stuff all our Dockerfiles should start with so we get caching ------------
#ARG IMAGE_VERSION=9.0.7-jre8
# possibly better, but does not build 9-jdk11-openjdk-buster
#ARG IMAGE_VERSION=9-jre11-slim
ARG IMAGE_VERSION=9-jdk11-openjdk-buster
ARG JAVA_HOME=/usr/local/openjdk-11
FROM tomcat:$IMAGE_VERSION
LABEL maintainer="Tim Sutton<[email protected]>"
## The Geoserver version
ARG GS_VERSION=2.18.1
## Would you like to use Oracle JDK
ARG ORACLE_JDK=false
## Would you like to keep default Tomcat webapps
ARG TOMCAT_EXTRAS=false
ARG WAR_URL=http://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
#Install extra fonts to use with sld font markers
RUN apt-get -y update; apt-get install -y fonts-cantarell lmodern fonts-font-awesome ttf-aenigma ttf-georgewilliams ttf-bitstream-vera \
ttf-sjfonts tv-fonts build-essential libapr1-dev libssl-dev gdal-bin libgdal-java wget zip curl xsltproc certbot \
certbot cabextract
RUN wget http://ftp.br.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.6_all.deb && \
dpkg -i ttf-mscorefonts-installer_3.6_all.deb && rm ttf-mscorefonts-installer_3.6_all.deb
RUN set -e \
export DEBIAN_FRONTEND=noninteractive \
dpkg-divert --local --rename --add /sbin/initctl \
&& (echo "Yes, do as I say!" | apt-get remove --force-yes login) \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV \
JAVA_HOME=${JAVA_HOME} \
STABLE_EXTENSIONS= \
COMMUNITY_EXTENSIONS= \
DEBIAN_FRONTEND=noninteractive \
GEOSERVER_DATA_DIR=/opt/geoserver/data_dir \
GDAL_DATA=/usr/local/gdal_data \
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/apr/lib:/opt/libjpeg-turbo/lib64:/usr/lib:/usr/lib/x86_64-linux-gnu:/usr/local/gdal_native_libs" \
FOOTPRINTS_DATA_DIR=/opt/footprints_dir \
GEOWEBCACHE_CACHE_DIR=/opt/geoserver/data_dir/gwc \
ENABLE_JSONP=true \
MAX_FILTER_RULES=20 \
OPTIMIZE_LINE_WIDTH=false \
SSL=false \
TOMCAT_EXTRAS=true \
HTTP_PORT=8080 \
HTTP_PROXY_NAME= \
HTTP_PROXY_PORT= \
HTTP_REDIRECT_PORT= \
HTTP_CONNECTION_TIMEOUT=20000 \
HTTPS_PORT=8443 \
HTTPS_MAX_THREADS=150 \
HTTPS_CLIENT_AUTH= \
HTTPS_PROXY_NAME= \
HTTPS_PROXY_PORT= \
JKS_FILE=letsencrypt.jks \
JKS_KEY_PASSWORD='geoserver' \
KEY_ALIAS=letsencrypt \
JKS_STORE_PASSWORD='geoserver' \
P12_FILE=letsencrypt.p12 \
PKCS12_PASSWORD='geoserver' \
LETSENCRYPT_CERT_DIR=/etc/letsencrypt \
RANDFILE=${LETSENCRYPT_CERT_DIR}/.rnd \
GEOSERVER_CSRF_DISABLED=true \
FONTS_DIR=/opt/fonts \
ENCODING='UTF8' \
TIMEZONE='GMT' \
CHARACTER_ENCODING='UTF-8' \
# cluster env variables
CLUSTERING=False \
CLUSTER_DURABILITY=true \
BROKER_URL= \
READONLY=disabled \
RANDOMSTRING=23bd87cfa327d47e \
INSTANCE_STRING=ac3bcba2fa7d989678a01ef4facc4173010cd8b40d2e5f5a8d18d5f863ca976f \
TOGGLE_MASTER=true \
TOGGLE_SLAVE=true \
EMBEDDED_BROKER=enabled \
DB_BACKEND= \
LOGIN_STATUS=on \
WEB_INTERFACE=false
WORKDIR /scripts
RUN mkdir -p ${GEOSERVER_DATA_DIR} ${LETSENCRYPT_CERT_DIR} ${FOOTPRINTS_DATA_DIR} ${FONTS_DIR} ${GEOWEBCACHE_CACHE_DIR}
ADD resources /tmp/resources
ADD build_data /build_data
RUN mkdir /community_plugins /stable_plugins /plugins
RUN cp /build_data/stable_plugins.txt /plugins && cp /build_data/community_plugins.txt /community_plugins && \
cp /build_data/log4j.properties ${CATALINA_HOME} && cp /build_data/web.xml ${CATALINA_HOME}/conf && \
cp /build_data/letsencrypt-tomcat.xsl ${CATALINA_HOME}/conf && \
cp /build_data/tomcat-users.xml /usr/local/tomcat/conf
ADD scripts /scripts
RUN chmod +x /scripts/*.sh
RUN /scripts/setup.sh \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV \
## Initial Memory that Java can allocate
INITIAL_MEMORY="2G" \
## Maximum Memory that Java can allocate
MAXIMUM_MEMORY="4G" \
XFRAME_OPTIONS="true" \
REQUEST_TIMEOUT=60 \
PARARELL_REQUEST=100 \
GETMAP=10 \
REQUEST_EXCEL=4 \
SINGLE_USER=6 \
GWC_REQUEST=16 \
WPS_REQUEST=1000/d;30s \
S3_SERVER_URL='' \
S3_USERNAME='' \
S3_PASSWORD='' \
SAMPLE_DATA='FALSE'\
GEOSERVER_FILEBROWSER_HIDEFS=false \
TOMCAT_PASSWORD='tomcat'
EXPOSE $HTTPS_PORT
RUN groupadd -r geoserverusers -g 10001 && \
useradd -m -d /home/geoserveruser/ --gid 10001 -s /bin/bash -G geoserverusers geoserveruser
RUN chown -R geoserveruser:geoserverusers ${CATALINA_HOME} ${FOOTPRINTS_DATA_DIR} \
${GEOSERVER_DATA_DIR} /scripts ${LETSENCRYPT_CERT_DIR} ${FONTS_DIR} /tmp/ /home/geoserveruser/ /community_plugins/ \
/plugins
RUN chmod o+rw ${LETSENCRYPT_CERT_DIR}
USER geoserveruser
VOLUME ["${GEOSERVER_DATA_DIR}", "${LETSENCRYPT_CERT_DIR}", "${FOOTPRINTS_DATA_DIR}", "${FONTS_DIR}", "${GEOWEBCACHE_CACHE_DIR}"]
WORKDIR ${CATALINA_HOME}
CMD ["/bin/sh", "/scripts/entrypoint.sh"]