source: trunk/Dockerfile @ 968

Last change on this file since 968 was 968, checked in by djay, 4 years ago

Add websocketd container to docker-compose and make the OGC API - Processes and it basic UI available.

File size: 5.2 KB
Line 
1#
2# Base: Ubuntu 18.04 with updates and external packages
3#
4FROM ubuntu:bionic-20201119 AS base
5ARG DEBIAN_FRONTEND=noninteractive
6ARG BUILD_DEPS=" \
7    dirmngr \
8    gpg-agent \
9    software-properties-common \
10"
11ARG RUN_DEPS=" \
12    libcurl3-gnutls \
13    libfcgi \
14    libmapserver-dev \
15    libmozjs185-dev \
16    libpq5 \
17    libpython3.6 \
18    libxslt1.1 \
19    gdal-bin \
20    python3 \
21    r-base \
22    python3-pip\
23"
24RUN set -ex \
25    && apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
26    \
27    && add-apt-repository ppa:osgeolive/nightly \
28    && add-apt-repository ppa:ubuntugis/ppa \
29    && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 \
30    && add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' \
31    \
32    && apt-get install -y $RUN_DEPS \
33    \
34    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
35    && rm -rf /var/lib/apt/lists/*
36
37#
38# builder1: base image with zoo-kernel
39#
40FROM base AS builder1
41ARG DEBIAN_FRONTEND=noninteractive
42ARG BUILD_DEPS=" \
43    bison \
44    flex \
45    make \
46    autoconf \
47    gcc \
48    gettext-base \
49    \
50    libfcgi-dev \
51    libgdal-dev \
52    libjson-c-dev \
53    libssh2-1-dev \
54    libssl-dev \
55    libxml2-dev \
56    libxslt1-dev \
57    python3-dev \
58    uuid-dev \
59    r-base-dev \
60"
61WORKDIR /zoo-project
62COPY . .
63
64RUN set -ex \
65    && apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
66    \
67    && make -C ./thirds/cgic206 libcgic.a \
68    \
69    && cd ./zoo-project/zoo-kernel \
70    && autoconf \
71    && ./configure --with-python=/usr --with-pyvers=3.6 --with-js=/usr --with-mapserver=/usr --with-ms-version=7 --with-json=/usr --with-db-backend --prefix=/usr \
72    && make \
73    && make install \
74    \
75    # TODO: why not copied by 'make'?
76    && cp zoo_loader.cgi main.cfg /usr/lib/cgi-bin/ \
77    && cp ../zoo-services/hello-py/cgi-env/* /usr/lib/cgi-bin/ \
78    && cp ../zoo-services/hello-js/cgi-env/* /usr/lib/cgi-bin/ \
79    && cp ../zoo-api/js/* /usr/lib/cgi-bin/ \
80    && cp ../zoo-services/utils/open-api/cgi-env/* /usr/lib/cgi-bin/ \
81    && cp ../zoo-services/hello-py/cgi-env/* /usr/lib/cgi-bin/ \
82    && cp ../zoo-services/hello-js/cgi-env/* /usr/lib/cgi-bin/ \
83    && cp ../zoo-api/js/* /usr/lib/cgi-bin/ \
84    \
85    && cp oas.cfg /usr/lib/cgi-bin/ \
86    \
87    # TODO: main.cfg is not processed \
88    && prefix=/usr envsubst < main.cfg > /usr/lib/cgi-bin/main.cfg \
89    \
90    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
91    && rm -rf /var/lib/apt/lists/*
92
93#
94# Optional zoo modules build.
95#
96FROM base AS builder2
97ARG DEBIAN_FRONTEND=noninteractive
98ARG BUILD_DEPS=" \
99    bison \
100    flex \
101    make \
102    autoconf \
103    g++ \
104    gcc \
105    libc-dev \
106    libfcgi-dev \
107    libgdal-dev \
108    libxml2-dev \
109    libxslt1-dev \
110"
111WORKDIR /zoo-project
112COPY ./zoo-project/zoo-services/utils/status ./zoo-project/zoo-services/utils/status
113
114# From zoo-kernel
115COPY --from=builder1 /usr/lib/cgi-bin/ /usr/lib/cgi-bin/
116COPY --from=builder1 /usr/lib/libzoo_service.so.1.8 /usr/lib/libzoo_service.so.1.8
117COPY --from=builder1 /usr/lib/libzoo_service.so /usr/lib/libzoo_service.so
118COPY --from=builder1 /usr/com/zoo-project/ /usr/com/zoo-project/
119COPY --from=builder1 /usr/include/zoo/ /usr/include/zoo/
120
121# Additional files from bulder2
122COPY --from=builder1 /zoo-project/zoo-project/zoo-kernel/ZOOMakefile.opts /zoo-project/zoo-project/zoo-kernel/ZOOMakefile.opts
123COPY --from=builder1 /zoo-project/zoo-project/zoo-kernel/sqlapi.h /zoo-project/zoo-project/zoo-kernel/sqlapi.h
124COPY --from=builder1 /zoo-project/zoo-project/zoo-kernel/service.h /zoo-project/zoo-project/zoo-kernel/service.h
125COPY --from=builder1 /zoo-project/zoo-project/zoo-kernel/service_internal.h /zoo-project/zoo-project/zoo-kernel/service_internal.h
126COPY --from=builder1 /zoo-project/zoo-project/zoo-kernel/version.h /zoo-project/zoo-project/zoo-kernel/version.h
127
128RUN set -ex \
129    && apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
130    \
131    && cd ./zoo-project/zoo-services/utils/status \
132    && make \
133    && make install \
134    \
135    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
136    && rm -rf /var/lib/apt/lists/*
137
138#
139# Runtime image with apache2.
140#
141FROM base AS runtime
142ARG DEBIAN_FRONTEND=noninteractive
143ARG RUN_DEPS=" \
144    apache2 \
145    curl \
146"
147
148# From zoo-kernel
149COPY --from=builder1 /usr/lib/cgi-bin/ /usr/lib/cgi-bin/
150COPY --from=builder1 /usr/lib/libzoo_service.so.1.8 /usr/lib/libzoo_service.so.1.8
151COPY --from=builder1 /usr/lib/libzoo_service.so /usr/lib/libzoo_service.so
152COPY --from=builder1 /usr/com/zoo-project/ /usr/com/zoo-project/
153COPY --from=builder1 /usr/include/zoo/ /usr/include/zoo/
154
155# From optional zoo modules
156COPY --from=builder2 /usr/lib/cgi-bin/ /usr/lib/cgi-bin/
157COPY --from=builder2 /usr/com/zoo-project/ /usr/com/zoo-project/
158
159RUN set -ex \
160    && apt-get update && apt-get install -y --no-install-recommends $RUN_DEPS \
161    \
162    && rm -rf /var/lib/apt/lists/* \
163    && pip3 install Cheetah3 redis\
164    && sed "s:AllowOverride None:AllowOverride All:g" -i /etc/apache2/apache2.conf \
165    && a2enmod cgi rewrite
166
167EXPOSE 80
168CMD /usr/sbin/apache2ctl -D FOREGROUND
Note: See TracBrowser for help on using the repository browser.

Search

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png