This repository has been archived by the owner on Mar 13, 2020. It is now read-only.
forked from KNMI/climate4impact-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
147 lines (123 loc) · 4.55 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
FROM centos:7
#TODO: put maintainer here
#MAINTAINER Climate4Impact Team at KNMI <?@knmi.nl>
VOLUME /config
VOLUME /data
EXPOSE 443
RUN yum update -y && yum install -y \
epel-release
RUN yum clean all && yum groupinstall -y "Development tools"
RUN yum update -y && yum install -y \
hdf5-devel \
netcdf \
netcdf-devel \
proj \
proj-devel \
sqlite \
sqlite-devel \
udunits2 \
udunits2-devel \
make \
# conda dependency
bzip2 \
# adaguc dependencies
libxml2-devel \
cairo-devel \
gd-devel \
postgresql-devel \
# java dependencies
ant \
tomcat \
gdal-devel
RUN mkdir /scr
WORKDIR /src
# conda
RUN curl -L -O https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
RUN bash ./Miniconda2-latest-Linux-x86_64.sh -p /miniconda -b
ENV PATH=/miniconda/bin:${PATH}
RUN conda update -y conda
RUN conda config --add channels conda-forge
# isntall python dependencies
RUN yes | pip install --upgrade pip
RUN conda update -y conda && conda install -y \
lxml \
numpy \
scipy \
netcdf4 \
python-dateutil \
isodate \
psycopg2 \
requests \
prov \
pydotplus
RUN pip install python-magic
# PyWPS does not work with versions higher than 56 for icu due some missing shared library issues
#RUN conda install icu
RUN conda install icu=56.1 -y
# install icclim (will be conda in the future)
RUN curl -L -O https://github.com/cerfacs-globc/icclim/archive/4.2.5.tar.gz
RUN tar xvf 4.2.5.tar.gz
WORKDIR /src/icclim-4.2.5
RUN gcc -fPIC -g -c -Wall ./icclim/libC.c -o ./icclim/libC.o
RUN gcc -shared -o ./icclim/libC.so ./icclim/libC.o
RUN python setup.py install
# install clipc combine toolkit
RUN pip install https://dev.knmi.nl/projects/clipccombine/repository/raw/dist/clipc_combine_process-1.6.tar.gz
# install provenance toolkit
WORKDIR /src
RUN curl -L -O https://github.com/KNMI/wps_prov/archive/master.tar.gz
RUN tar xvf master.tar.gz
WORKDIR /src/wps_prov-master
RUN python setup.py install
# install pywps
WORKDIR /src
RUN curl -L -O https://github.com/geopython/pywps/archive/pywps-3.2.5.tar.gz
RUN tar xvf pywps-3.2.5.tar.gz
# the rest is setting up the env variables but those paths will depend on monted data dir
# install adaguc
WORKDIR /src
RUN curl -L https://github.com/KNMI/adaguc-server/archive/master.tar.gz > adaguc-server.tar.gz
RUN tar xvf adaguc-server.tar.gz
RUN mv /src/adaguc-server-master /src/adaguc-server
WORKDIR /src/adaguc-server
ENV ADAGUCCOMPONENTS="-DENABLE_CURL -DADAGUC_USE_POSTGRESQL -DADAGUC_USE_SQLITE -DADAGUC_USE_GDAL"
RUN bash compile.sh
# Copy adaguc binaries to /usr/bin
RUN cp bin/* /usr/bin/
# install impact portal
WORKDIR /src
COPY build.xml /src/climate4impact-portal/
COPY src /src/climate4impact-portal/src/
COPY WebContent /src/climate4impact-portal/WebContent/
WORKDIR /src/climate4impact-portal
ENV TOMCAT_LIBS=/usr/share/java/tomcat
RUN ant
# install impactportal wps scripts
RUN mkdir /src/wpsprocesses
WORKDIR /src/wpsprocesses
RUN curl -L https://github.com/KNMI/impactwps/archive/master.tar.gz > climate4impactwpsscripts.tar.gz
RUN tar xvf climate4impactwpsscripts.tar.gz
# Install certificates
RUN mkdir -p /root/.globus/
WORKDIR /root/.globus/
RUN curl -L https://raw.githubusercontent.com/ESGF/esgf-dist/master/installer/certs/esg_trusted_certificates.tar > esg_trusted_certificates.tar
RUN tar -xvf esg_trusted_certificates.tar
RUN mv esg_trusted_certificates certificates
# configure server
RUN mv /usr/share/tomcat/conf/server.xml /usr/share/tomcat/conf/server_oryg.xml
RUN ln -s /config/server.xml /usr/share/tomcat/conf/server.xml
RUN cp /src/climate4impact-portal/impactportal.war /usr/share/tomcat/webapps/
ENV IMPACTPORTAL_CONFIG=/config/config.xml
# TODO check why this is needed
RUN conda install icu -y
# Insert local instance trustroot into truststore
#CMD keytool -export -alias tomcat -rfc -file /root/.globus/certificates/tomcat.pem -keystore /config/c4i_keystore.jks -storepass password
#CMD keytool -import -v -trustcacerts -alias tomcat -file /root/.globus/certificates/tomcat.pem -keystore /config/esg-truststore.ts -storepass changeit -noprompt
#CMD c_rehash /root/.globus/certificates
#CMD /bin/bash
CMD mkdir -p /data/wpsoutputs && \
mkdir -p /data/c4i/climate4impact-portal/impactspace && \
/usr/libexec/tomcat/server start
#Build with docker build -t climate4impact-portal ./climate4impact-portal/Docker/
#This docker container needs to be runned with custom configuration settings: docker run -i -t -p 443:443 -v $HOME/config:/config climate4impact-portal
#Visit https://192.168.99.100/impactportal/ to go to the portal