-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (51 loc) · 2.16 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
FROM openjdk:8-jre-alpine
ARG version=2.18.2
ARG branch=2.18.2
ARG plugins=
# Install dependencies
RUN apk add --no-cache ca-certificates openssl curl postgresql-client fontconfig ttf-ubuntu-font-family
RUN update-ca-certificates
WORKDIR /
# Download Geoserver
# we first download vanilla geoserver, as it comes with preset jetty and launch scripts
# then we replace it with the geonode build
# TODO : this is a bit dirty..... can't we stat from vanilla Geoserver ?
# TODO : merge into on step
RUN echo "Download geoserver for geonode" && \
wget https://downloads.sourceforge.net/project/geoserver/GeoServer/$version/geoserver-$version-bin.zip && \
wget https://www.dropbox.com/s/xlich7pmneaupqp/geoserver-$branch.war?dl=1 -O geoserver-$branch.war --no-check-certificate && \
mkdir -p geoserver-$version && \
unzip geoserver-$version-bin.zip -d geoserver-$version && \
mv geoserver-$version geoserver && \
rm /geoserver-$version-bin.zip && \
rm /geoserver-$version/webapps/geoserver/* -rf && \
unzip -o geoserver-$branch.war -d /geoserver/webapps/geoserver/ && \
rm /geoserver-$branch.war
# Plugins support
# Example:
# $ docker-compose build --build-arg plugins="csw" geoserver
RUN for plugin in $plugins; do \
wget https://downloads.sourceforge.net/project/geoserver/GeoServer/$version/extensions/geoserver-$version-$plugin-plugin.zip && \
unzip -o geoserver-$version-$plugin-plugin.zip -d /geoserver/webapps/geoserver/WEB-INF/lib && \
rm geoserver-$version-$plugin-plugin.zip; \
done
# Download initial data dir
RUN wget https://www.dropbox.com/s/q0qc2t7d9alo9fk/data-$branch.zip?dl=1 -O data-$branch.zip --no-check-certificate && \
unzip /data-$branch.zip
WORKDIR /geoserver/
# Add the entrypoint
ADD docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
# Export ports
EXPOSE 8080
# Set environnment variables
ENV \
GEOSERVER_HOME=/geoserver \
GEOSERVER_DATA_DIR=/spcgeonode-geodatadir \
GEOWEBCACHE_CACHE_DIR=/spcgeonode-geodatadir/gwc \
GEOSERVER_CSRF_DISABLED=true \
INITIAL_MEMORY=2G \
MAXIMUM_MEMORY=4G
# Run geoserver
CMD ["bin/startup.sh"]