forked from KNMI/adaguc-services
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
117 lines (87 loc) · 3.48 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
FROM centos:7
MAINTAINER Adaguc Team at KNMI <[email protected]>
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 \
libxml2-devel \
cairo-devel \
gd-devel \
postgresql-devel \
postgresql-server \
gdal-devel \
tomcat \
maven
RUN mkdir /src
WORKDIR /src
# Configure postgres
RUN mkdir /postgresql
RUN touch /var/log/postgresql.log
RUN chown postgres: /postgresql/
RUN chown postgres: /var/log/postgresql.log
RUN runuser -l postgres -c "initdb -D /postgresql"
# Install adaguc-server
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
WORKDIR /src/adaguc-server-master
RUN bash compile.sh
# 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
# Install adaguc-services
WORKDIR /src
RUN mkdir adaguc-services
COPY . /src/adaguc-services/
WORKDIR /src/adaguc-services
RUN mvn package
RUN mkdir /keystore/
RUN keytool -genkey -noprompt -keypass password -alias tomcat -keyalg RSA -storepass password -keystore /keystore/c4i_keystore.jks -dname CN=compute-test.c3s-magic.eu
# Set up data dir, this is also configured in adaguc.docker.xml
RUN mkdir /data/
#Setup directory for automatic visualization of NetCDF's
RUN mkdir /data/adaguc-autowms
#Setup directory for visualization of ADAGUC datasets
RUN mkdir /data/adaguc-datasets
RUN mkdir /data/adaguc-datasets-spaces/
RUN mkdir /src/wpsoutputs
RUN mkdir /src/adaguc-services-tmp/
EXPOSE 9000
# Install certificates
RUN mkdir -p /config/
WORKDIR /config/
# RUN curl -L https://raw.githubusercontent.com/ESGF/esgf-dist/master/installer/certs/esg_trusted_certificates.tar > esg_trusted_certificates.tar
RUN curl -L https://raw.githubusercontent.com/ESGF/esgf-dist/master/installer/certs/esg-truststore.ts > esg-truststore.ts
#RUN tar -xvf esg_trusted_certificates.tar
#RUN mv esg_trusted_certificates certificates
# Configure adaguc-services
COPY ./docker/adaguc-services-config.xml /root/adaguc-services-config.xml
ENV ADAGUC_SERVICES_CONFIG=/root/adaguc-services-config.xml
WORKDIR /src/adaguc-services
CMD echo "Starting POSTGRESQL DB" && \
runuser -l postgres -c "pg_ctl -D /postgresql -l /var/log/postgresql.log start" && \
sleep 1 && \
mkdir -p /data/adaguc-autowms/ && \
mkdir -p /data/adaguc-datasets/ && \
cp /src/adaguc-server-master/data/datasets/testdata.nc /data/adaguc-autowms/ && \
cp /src/adaguc-server-master/data/config/datasets/dataset_a.xml /data/adaguc-datasets/ && \
echo "Configuring POSTGRESQL DB" && \
runuser -l postgres -c "createuser --superuser adaguc" && \
runuser -l postgres -c "psql postgres -c \"ALTER USER adaguc PASSWORD 'adaguc';\"" && \
runuser -l postgres -c "psql postgres -c \"CREATE DATABASE adaguc;\"" && \
echo "Starting TOMCAT Server" && \
java -jar ./target/adaguc-services-1.0.0-SNAPSHOT.war
# Build with docker build -t adagucservices:alpha .
# docker run -it -p9000:8080 adagucservices:alpha bash
# You can copy NetCDF's / GeoJSONS to your hosts ~/data directory. This will be served through adaguc-server, via the source=<filename> key value pair. testdata.nc is copied there by default. See example URL above.