8
8
# <http://switch2osm.org/serving-tiles/manually-building-a-tile-server-12-04/>.
9
9
#
10
10
11
- FROM ncareol /baseimage:0.9.18
11
+ FROM phusion /baseimage:latest
12
12
MAINTAINER Erik Johnson <
[email protected] >
13
13
14
- # Set the locale. This affects the encoding of the Postgresql template
15
- # databases.
16
- ENV LANG C.UTF-8
17
- RUN update-locale LANG=C.UTF-8
18
14
19
15
# Ensure `add-apt-repository` is present
20
16
RUN apt-get update -y
@@ -23,12 +19,15 @@ RUN apt-get install -y software-properties-common python-software-properties
23
19
RUN apt-get install -y libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-system-dev libboost-thread-dev
24
20
25
21
# Install remaining dependencies
26
- RUN apt-get install -y subversion git-core tar unzip wget bzip2 build-essential autoconf libtool libxml2-dev libgeos-dev libpq-dev libbz2-dev munin-node munin libprotobuf-c0-dev protobuf-c-compiler libfreetype6-dev libpng12-dev libtiff4 -dev libicu-dev libgdal-dev libcairo-dev libcairomm-1.0-dev apache2 apache2-dev libagg-dev liblua5.2-dev ttf-unifont
22
+ RUN apt-get install -y subversion git-core tar unzip wget bzip2 build-essential autoconf libtool libxml2-dev libgeos-dev libpq-dev libbz2-dev munin-node munin libprotobuf-c0-dev protobuf-c-compiler libfreetype6-dev libpng12-dev libtiff5 -dev libicu-dev libgdal-dev libcairo-dev libcairomm-1.0-dev apache2 apache2-dev libagg-dev liblua5.2-dev ttf-unifont
27
23
28
- RUN apt-get install -y autoconf apache2-dev libtool libxml2-dev libbz2-dev libgeos-dev libgeos++-dev libproj-dev gdal-bin libgdal1-dev mapnik-utils python-mapnik libmapnik-dev
24
+ RUN apt-get install -y autoconf apache2-dev libtool libxml2-dev libbz2-dev libgeos-dev libgeos++-dev libproj-dev gdal-bin libgdal1-dev sudo
25
+
26
+ # Install OpenTopoMap dependencies
27
+ RUN apt-get install -y python3-setuptools python3-matplotlib python3-bs4 python3-numpy python3-gdal python-gdal
29
28
30
29
# Install postgresql and postgis
31
- RUN apt-get install -y postgresql-9.3-postgis-2.1 postgresql-contrib postgresql-server-dev-9.3
30
+ RUN apt-get install -y postgresql postgresql-contrib postgis postgresql-9.5-postgis-2.2
32
31
33
32
# Install osm2pgsql
34
33
RUN cd /tmp && git clone git://github.com/openstreetmap/osm2pgsql.git && \
@@ -39,17 +38,9 @@ RUN cd /tmp && git clone git://github.com/openstreetmap/osm2pgsql.git && \
39
38
make && make install && \
40
39
cd /tmp && rm -rf /tmp/osm2pgsql
41
40
42
- # TODO: mapnik 3.0.5
43
41
44
42
# Install the Mapnik library
45
- RUN cd /tmp && git clone git://github.com/mapnik/mapnik && \
46
- cd /tmp/mapnik && \
47
- git checkout 2.2.x && \
48
- python scons/scons.py configure INPUT_PLUGINS=all OPTIMIZATION=3 SYSTEM_FONTS=/usr/share/fonts/truetype/ && \
49
- python scons/scons.py && \
50
- python scons/scons.py install && \
51
- ldconfig && \
52
- cd /tmp && rm -rf /tmp/mapnik
43
+ RUN apt-get install -y libmapnik3.0 libmapnik-dev mapnik-utils python-mapnik unifont
53
44
54
45
# Verify that Mapnik has been installed correctly
55
46
RUN python -c 'import mapnik'
@@ -65,12 +56,22 @@ RUN cd /tmp && git clone git://github.com/openstreetmap/mod_tile.git && \
65
56
ldconfig && \
66
57
cd /tmp && rm -rf /tmp/mod_tile
67
58
59
+ # Install phyghtmap (OpenTopoMap)
60
+ RUN cd /tmp && wget http://katze.tfiu.de/projects/phyghtmap/phyghtmap_2.20.orig.tar.gz && \
61
+ tar -xvzf phyghtmap_2.20.orig.tar.gz && \
62
+ rm *.gz && \
63
+ cd phyghtmap-2.20 && \
64
+ python3 setup.py install
65
+
68
66
# Install the Mapnik stylesheet
69
67
RUN cd /usr/local/src && svn co http://svn.openstreetmap.org/applications/rendering/mapnik mapnik-style
70
68
71
69
# Install the coastline data
72
70
RUN cd /usr/local/src/mapnik-style && ./get-coastlines.sh /usr/local/share
73
71
72
+ # Download OpenTopoMap data
73
+ RUN cd /root && git clone https://github.com/der-stefan/OpenTopoMap.git && chmod go+rx /root/ && ln -s /data /root/OpenTopoMap/mapnik/ && chown -R www-data OpenTopoMap
74
+
74
75
# Configure mapnik style-sheets
75
76
RUN cd /usr/local/src/mapnik-style/inc && cp fontset-settings.xml.inc.template fontset-settings.xml.inc
76
77
ADD datasource-settings.sed /tmp/
@@ -79,27 +80,32 @@ ADD settings.sed /tmp/
79
80
RUN cd /usr/local/src/mapnik-style/inc && sed --file /tmp/settings.sed settings.xml.inc.template > settings.xml.inc
80
81
81
82
# Configure renderd
82
- ADD renderd.conf.sed /tmp/
83
- RUN cd /usr/local/etc && sed --file /tmp/renderd.conf.sed --in-place renderd.conf
83
+ ADD renderd.conf /tmp/
84
+ RUN cd /usr/local/etc && mv /tmp/renderd.conf .
84
85
85
86
# Create the files required for the mod_tile system to run
86
87
RUN mkdir /var/run/renderd && chown www-data: /var/run/renderd
87
88
RUN mkdir /var/lib/mod_tile && chown www-data /var/lib/mod_tile
88
89
89
90
# Replace default apache index page with OpenLayers demo
90
- ADD index.html /var/www/html/index.html
91
+ ADD www/* /var/www/html/
91
92
92
93
# Configure mod_tile
93
94
ADD mod_tile.load /etc/apache2/mods-available/
94
95
ADD mod_tile.conf /etc/apache2/mods-available/
95
96
RUN a2enmod mod_tile
96
97
97
98
# Ensure the webserver user can connect to the gis database
98
- RUN sed -i -e 's/local all all peer/local gis www-data peer/' /etc/postgresql/9.3/main/pg_hba.conf
99
+ RUN sed -i -e 's/local all all peer/host all all 0\. 0\. 0\. 0\/ 0 trust/' /etc/postgresql/9.5/main/pg_hba.conf
100
+ RUN echo 'local gis www-data peer' >> /etc/postgresql/9.5/main/pg_hba.conf && \
101
+ echo 'local lowzoom www-data peer' >> /etc/postgresql/9.5/main/pg_hba.conf && \
102
+ echo 'local postgres www-data peer' >> /etc/postgresql/9.5/main/pg_hba.conf && \
103
+ echo 'local template1 www-data peer' >> /etc/postgresql/9.5/main/pg_hba.conf && \
104
+ echo 'local contours www-data peer' >> /etc/postgresql/9.5/main/pg_hba.conf
99
105
100
106
# Tune postgresql
101
107
ADD postgresql.conf.sed /tmp/
102
- RUN sed --file /tmp/postgresql.conf.sed --in-place /etc/postgresql/9.3 /main/postgresql.conf
108
+ RUN sed --file /tmp/postgresql.conf.sed --in-place /etc/postgresql/9.5 /main/postgresql.conf
103
109
104
110
# Define the application logging logic
105
111
ADD syslog-ng.conf /etc/syslog-ng/conf.d/local.conf
@@ -121,7 +127,7 @@ RUN update-service --add /etc/sv/renderd
121
127
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
122
128
123
129
# Expose the webserver and database ports
124
- EXPOSE 80 5432
130
+ EXPOSE 80 80
125
131
126
132
# We need the volume for importing data from
127
133
VOLUME ["/data" ]
@@ -140,5 +146,6 @@ ADD help.txt /usr/local/share/doc/run/help.txt
140
146
ADD run.sh /usr/local/sbin/run
141
147
ENTRYPOINT ["/sbin/my_init" , "--" , "/usr/local/sbin/run" ]
142
148
149
+
143
150
# Default to showing the usage text
144
151
CMD ["help" ]
0 commit comments