latest postgres 10; multithread make

This commit is contained in:
Grzegorz Adam Kowalski 2019-03-15 16:50:46 +01:00
parent 7e87c26e0e
commit 16b85cb9e2

View File

@ -8,7 +8,9 @@ ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install dependencies # Install dependencies
RUN apt-get update && apt-get install -y \ RUN echo "deb [ allow-insecure=yes ] http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" >> /etc/apt/sources.list.d/pgdg.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends --allow-unauthenticated \
apache2 \ apache2 \
apache2-dev \ apache2-dev \
autoconf \ autoconf \
@ -18,14 +20,11 @@ RUN apt-get update && apt-get install -y \
fonts-noto-cjk \ fonts-noto-cjk \
fonts-noto-hinted \ fonts-noto-hinted \
fonts-noto-unhinted \ fonts-noto-unhinted \
g++ \ clang \
gdal-bin \ gdal-bin \
git-core \ git-core \
libagg-dev \ libagg-dev \
libboost-all-dev \ libboost-all-dev \
libboost-dev \
libboost-filesystem-dev \
libboost-system-dev \
libbz2-dev \ libbz2-dev \
libcairo-dev \ libcairo-dev \
libcairomm-1.0-dev \ libcairomm-1.0-dev \
@ -36,8 +35,7 @@ RUN apt-get update && apt-get install -y \
libgeos-dev \ libgeos-dev \
libgeotiff-epsg \ libgeotiff-epsg \
libicu-dev \ libicu-dev \
liblua5.1-dev \ liblua5.3-dev \
liblua5.2-dev \
libmapnik-dev \ libmapnik-dev \
libpq-dev \ libpq-dev \
libproj-dev \ libproj-dev \
@ -45,16 +43,15 @@ RUN apt-get update && apt-get install -y \
libtiff5-dev \ libtiff5-dev \
libtool \ libtool \
libxml2-dev \ libxml2-dev \
lua5.1 \ lua5.3 \
lua5.2 \
make \ make \
mapnik-utils \ mapnik-utils \
nodejs \ nodejs \
npm \ npm \
postgis \ postgis \
postgresql \ postgresql-10 \
postgresql-10-postgis-2.4 \ postgresql-10-postgis-2.4 \
postgresql-contrib \ postgresql-contrib-10 \
protobuf-c-compiler \ protobuf-c-compiler \
python-mapnik \ python-mapnik \
sudo \ sudo \
@ -62,12 +59,17 @@ RUN apt-get update && apt-get install -y \
ttf-unifont \ ttf-unifont \
unzip \ unzip \
wget \ wget \
zlib1g-dev zlib1g-dev \
&& apt-get clean autoclean \
&& apt-get autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
# Set up renderer user # Set up renderer user
RUN adduser --disabled-password --gecos "" renderer RUN adduser --disabled-password --gecos "" renderer
USER renderer USER renderer
ENV GIT_SSL_NO_VERIFY=true
# Install latest osm2pgsql # Install latest osm2pgsql
RUN mkdir /home/renderer/src RUN mkdir /home/renderer/src
WORKDIR /home/renderer/src WORKDIR /home/renderer/src
@ -75,8 +77,8 @@ RUN git clone https://github.com/openstreetmap/osm2pgsql.git
WORKDIR /home/renderer/src/osm2pgsql WORKDIR /home/renderer/src/osm2pgsql
RUN mkdir build RUN mkdir build
WORKDIR /home/renderer/src/osm2pgsql/build WORKDIR /home/renderer/src/osm2pgsql/build
RUN cmake .. RUN cmake .. \
RUN make && make -j $(nproc)
USER root USER root
RUN make install RUN make install
USER renderer USER renderer
@ -88,13 +90,13 @@ RUN python -c 'import mapnik'
WORKDIR /home/renderer/src WORKDIR /home/renderer/src
RUN git clone -b switch2osm https://github.com/SomeoneElseOSM/mod_tile.git RUN git clone -b switch2osm https://github.com/SomeoneElseOSM/mod_tile.git
WORKDIR /home/renderer/src/mod_tile WORKDIR /home/renderer/src/mod_tile
RUN ./autogen.sh RUN ./autogen.sh \
RUN ./configure && ./configure \
RUN make && make -j $(nproc)
USER root USER root
RUN make install RUN make -j $(nproc) install \
RUN make install-mod_tile && make -j $(nproc) install-mod_tile \
RUN ldconfig && ldconfig
USER renderer USER renderer
# Configure stylesheet # Configure stylesheet
@ -102,28 +104,30 @@ WORKDIR /home/renderer/src
RUN git clone https://github.com/gravitystorm/openstreetmap-carto.git RUN git clone https://github.com/gravitystorm/openstreetmap-carto.git
WORKDIR /home/renderer/src/openstreetmap-carto WORKDIR /home/renderer/src/openstreetmap-carto
USER root USER root
RUN npm install -g carto RUN npm config set strict-ssl=false \
&& npm install -g carto
USER renderer USER renderer
RUN carto project.mml > mapnik.xml RUN carto project.mml > mapnik.xml
# Load shapefiles # Load shapefiles
WORKDIR /home/renderer/src/openstreetmap-carto WORKDIR /home/renderer/src/openstreetmap-carto
ENV PYTHONHTTPSVERIFY=0
RUN scripts/get-shapefiles.py RUN scripts/get-shapefiles.py
# Configure renderd # Configure renderd
USER root USER root
RUN sed -i 's/renderaccount/renderer/g' /usr/local/etc/renderd.conf RUN sed -i 's/renderaccount/renderer/g' /usr/local/etc/renderd.conf \
RUN sed -i 's/hot/tile/g' /usr/local/etc/renderd.conf && sed -i 's/hot/tile/g' /usr/local/etc/renderd.conf
USER renderer USER renderer
# Configure Apache # Configure Apache
USER root USER root
RUN mkdir /var/lib/mod_tile RUN mkdir /var/lib/mod_tile \
RUN chown renderer /var/lib/mod_tile && chown renderer /var/lib/mod_tile \
RUN mkdir /var/run/renderd && mkdir /var/run/renderd \
RUN chown renderer /var/run/renderd && chown renderer /var/run/renderd
RUN echo "LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so" >> /etc/apache2/conf-available/mod_tile.conf RUN echo "LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so" >> /etc/apache2/conf-available/mod_tile.conf \
RUN a2enconf mod_tile && a2enconf mod_tile
COPY apache.conf /etc/apache2/sites-available/000-default.conf COPY apache.conf /etc/apache2/sites-available/000-default.conf
COPY leaflet-demo.html /var/www/html/index.html COPY leaflet-demo.html /var/www/html/index.html