This repository was archived by the owner on Jul 26, 2018. It is now read-only.
forked from makinacorpus/osm-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
93 lines (74 loc) · 4.06 KB
/
Dockerfile
File metadata and controls
93 lines (74 loc) · 4.06 KB
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
FROM debian:jessie
# Setup everything
# extent (xmin,ymin,xmax,ymax)
ENV EXTENT -167.7,-59.4,194.8,85.1
ENV DB_HOST osm-db
ENV DB_NAME osm
ENV DB_USER osm
ENV DB_PASSWORD osm
ENV OSM_DATA /usr/share/mapnik-osm-data/world_boundaries
ENV STYLES_PATH /etc/mapnik-osm-data/makina
ENV RENDERD_CONF /etc/renderd.conf
ENV PREVIEW_CONF /var/www/conf.js
# Install deps
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y git curl wget libgdal1h gdal-bin mapnik-utils unzip \
apache2 dpkg-dev debhelper apache2-dev supervisor \
libmapnik-dev autoconf automake m4 libtool libcurl4-gnutls-dev \
libcairo2-dev apache2-mpm-event osm2pgsql && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Install software
RUN git clone --recursive --depth=50 https://github.com/floweb/osm-mirror && \
git clone https://github.com/makinacorpus/mod_tile && \
cd mod_tile && dpkg-buildpackage && cd .. && \
dpkg -i renderd_0.4.1_amd64.deb && \
dpkg -i libapache2-mod-tile_0.4.1_amd64.deb
# Load world boundaries data...
RUN mkdir -p $OSM_DATA && \
rm -rf $OSM_DATA/ne_10m_populated_places_fixed.* && \
curl -L -o "/tmp/ne_10m_populated_places.zip" "http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places.zip" && \
unzip -qqu /tmp/ne_10m_populated_places.zip -d /tmp && \
mv /tmp/ne_10m_populated_places.* $OSM_DATA/ && \
ogr2ogr $OSM_DATA/ne_10m_populated_places_fixed.shp $OSM_DATA/ne_10m_populated_places.shp && \
curl -L -o "/tmp/simplified-land-polygons-complete-3857.zip" "http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip" && \
unzip -qqu /tmp/simplified-land-polygons-complete-3857.zip simplified-land-polygons-complete-3857/simplified_land_polygons.* -d /tmp && \
mv /tmp/simplified-land-polygons-complete-3857/simplified_land_polygons.* $OSM_DATA/ && \
curl -L -o "/tmp/land-polygons-split-3857.zip" "http://data.openstreetmapdata.com/land-polygons-split-3857.zip" && \
unzip -qqu /tmp/land-polygons-split-3857.zip -d /tmp && \
mv /tmp/land-polygons-split-3857/land_polygons.* $OSM_DATA/ && \
curl -L -o "/tmp/coastline-good.zip" "http://tilemill-data.s3.amazonaws.com/osm/coastline-good.zip" && \
unzip -qqu /tmp/coastline-good.zip -d /tmp && \
mv /tmp/coastline-good.* $OSM_DATA/ && \
curl -L -o "/tmp/shoreline_300.tar.bz2" "http://tile.openstreetmap.org/shoreline_300.tar.bz2" && \
tar -xf /tmp/shoreline_300.tar.bz2 -C /tmp && \
mv /tmp/shoreline_300.* $OSM_DATA/ && \
curl -L -o "/tmp/world_boundaries-spherical.tgz" "http://planet.openstreetmap.org/historical-shapefiles/world_boundaries-spherical.tgz" && \
tar -xf /tmp/world_boundaries-spherical.tgz -C /tmp && \
mv /tmp/world_boundaries/builtup_area.* $OSM_DATA/ && \
curl -L -o "/tmp/ne_110m_admin_0_boundary_lines_land.zip" "http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip" && \
unzip -qqu /tmp/ne_110m_admin_0_boundary_lines_land.zip -d /tmp && \
mv /tmp/ne_110m_admin_0_boundary_lines_land.* $OSM_DATA/ && \
curl -L -o "/tmp/10m-land.zip" "http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.3.0/physical/10m-land.zip" && \
unzip -qqu /tmp/10m-land.zip -d /tmp && \
mv /tmp/10m-land.* $OSM_DATA/ && \
rm -rf /tmp/*
RUN shapeindex --shape_files \
$OSM_DATA/simplified_land_polygons.shp \
$OSM_DATA/land_polygons.shp \
$OSM_DATA/coastline-good.shp \
$OSM_DATA/10m-land.shp \
$OSM_DATA/shoreline_300.shp \
$OSM_DATA/ne_10m_populated_places_fixed.shp \
$OSM_DATA/builtup_area.shp \
$OSM_DATA/ne_110m_admin_0_boundary_lines_land.shp
# Deploy preview map...
# RUN rm -rf /var/www/html && cp -R preview/* /var/www/
# Deploy map styles...
# RUN mkdir -p $STYLES_PATH && cp -R styles/* $STYLES_PATH
# Setup renderd
RUN install --owner=www-data --group=www-data -d /var/run/renderd
# Setup supervisord
COPY supervisord.conf /etc/supervisord.conf
EXPOSE 80
CMD ["/usr/bin/supervisord", "--nodaemon", "--configuration=/etc/supervisord.conf"]