-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
35 lines (29 loc) · 1.99 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
FROM ubuntu:16.04
# Prerequisites and runtimes
COPY setup-node.sh /tmp/setup-node.sh
RUN bash /tmp/setup-node.sh && rm /tmp/setup-node.sh
RUN apt-get upgrade -y && apt-get install -y --no-install-recommends \
build-essential sudo software-properties-common curl \
libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-system-dev libboost-thread-dev libicu-dev libtiff5-dev libfreetype6-dev libpng12-dev libxml2-dev libproj-dev libsqlite3-dev libgdal-dev libcairo-dev python-cairo-dev postgresql-contrib libharfbuzz-dev \
nodejs python3-dev python-dev git python-pip python-setuptools python-wheel python3-setuptools python3-pip python3-wheel
# Mapnik
ENV MAPNIK_VERSION 3.0.10
RUN curl -s https://mapnik.s3.amazonaws.com/dist/v${MAPNIK_VERSION}/mapnik-v${MAPNIK_VERSION}.tar.bz2 | tar -xj -C /tmp/
RUN cd /tmp/mapnik-v${MAPNIK_VERSION} && python scons/scons.py configure
RUN cd /tmp/mapnik-v${MAPNIK_VERSION} && make JOBS=4 && make install JOBS=4
# Node Bindings
ENV NODE_MAPNIK_VERSION 3.5.13
RUN mkdir -p /opt/node-mapnik && curl -L https://github.com/mapnik/node-mapnik/archive/v${NODE_MAPNIK_VERSION}.tar.gz | tar xz -C /opt/node-mapnik --strip-components=1
RUN cd /opt/node-mapnik && npm install --unsafe-perm=true --build-from-source && npm link
# Python Bindings
ENV PYTHON_MAPNIK_COMMIT 3a60211dee366060acf4e5e0de8b621b5924f2e6
RUN mkdir -p /opt/python-mapnik && curl -L https://github.com/mapnik/python-mapnik/archive/${PYTHON_MAPNIK_COMMIT}.tar.gz | tar xz -C /opt/python-mapnik --strip-components=1
RUN cd /opt/python-mapnik && python2 setup.py install && python3 setup.py install && rm -r /opt/python-mapnik/build
# Tests
RUN apt-get install -y unzip
RUN mkdir -p /opt/demos
COPY world.py /opt/demos/world.py
COPY 110m-admin-0-countries.zip /opt/demos/110m-admin-0-countries.zip
RUN cd /opt/demos && unzip 110m-admin-0-countries.zip && rm 110m-admin-0-countries.zip
COPY world.js /opt/demos/world.js
COPY stylesheet.xml /opt/demos/stylesheet.xml