Compare commits

..

15 Commits

Author SHA1 Message Date
Alexander Overvoorde
953232051f Show progress output for wget by default (fixes #156) 2020-10-27 20:55:02 +01:00
Alexander Overvoorde
bedff2a880 Merge pull request #150 from ph1ll/patch-1
Fix Osmosis configuration change
2020-09-17 21:40:58 +02:00
Ph1ll
e79901b7dd Fix Osmosis configuration change 2020-09-16 10:05:33 +01:00
Alexander Overvoorde
5a059ab0a5 Merge pull request #140 from Floyddotnet/master
small improvement of build time and image size
2020-06-03 18:46:28 +02:00
Peter Becker
bcf2cfcada combine several apt install calls 2020-06-03 09:24:05 +00:00
Peter Becker
0e1db36457 fix shallow fetch for osm2pgsql and mod-tile 2020-06-03 09:24:05 +00:00
Peter Becker
677b52468e execute all make calls in parallel 2020-06-03 09:23:54 +00:00
Alexander Overvoorde
1093734e1b Merge branch 'Mou97-master' 2020-06-01 14:12:30 +02:00
Alexander Overvoorde
9fb0743c51 Fix shallow fetch for openstreetmap-carto 2020-06-01 14:11:52 +02:00
Mou97
19cb75baa4 removed git command thats fetches the whole history after a shallow clone 2020-05-31 01:21:42 +01:00
Mou97
82bc6a35a3 renamed Dockerfile-badInternet to Dockerfile 2020-05-29 18:58:57 +01:00
Mou97
44490df8c5 added a dockerfile version to avoid 'connection closed: RPC failed' error when cloning big repos 2020-05-29 14:23:36 +01:00
Alexander Overvoorde
6dc84f1d26 Merge pull request #135 from Istador/patch-1 2020-05-15 18:50:46 +02:00
Robin C. Ladiges
26a4b9f239 OSM2PGSQL_EXTRA_ARGS inside quotes
This commit fixes issue #133.
2020-05-15 16:24:01 +02:00
Alexander Overvoorde
2754592d1c Rearrange OSM2PGSQL_EXTRA_ARGS to allow overriding of existing parameters (fixes #112) 2020-04-26 19:00:59 +02:00
3 changed files with 15 additions and 16 deletions

View File

@@ -11,14 +11,11 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install dependencies # Install dependencies
RUN apt-get update \ RUN apt-get update \
&& apt-get install wget gnupg2 lsb-core -y \ && apt-get install -y wget gnupg2 lsb-core apt-transport-https ca-certificates curl \
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb [ trusted=yes ] https://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ && echo "deb [ trusted=yes ] https://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \
&& apt-get update \
&& apt-get install -y apt-transport-https ca-certificates
RUN apt-get install -y curl \
&& wget --quiet -O - https://deb.nodesource.com/setup_10.x | bash - \ && wget --quiet -O - https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get update \
&& apt-get install -y nodejs && apt-get install -y nodejs
RUN apt-get install -y --no-install-recommends \ RUN apt-get install -y --no-install-recommends \
@@ -87,7 +84,9 @@ RUN wget https://download.osgeo.org/postgis/source/postgis-3.0.0.tar.gz -O postg
&& tar -xvzf postgis.tar.gz --strip 1 -C postgis_src \ && tar -xvzf postgis.tar.gz --strip 1 -C postgis_src \
&& rm postgis.tar.gz \ && rm postgis.tar.gz \
&& cd postgis_src \ && cd postgis_src \
&& ./configure && make && make install \ && ./configure \
&& make -j $(nproc) \
&& make -j $(nproc) install \
&& cd .. && rm -rf postgis_src && cd .. && rm -rf postgis_src
# Set up renderer user # Set up renderer user
@@ -96,14 +95,14 @@ RUN adduser --disabled-password --gecos "" renderer
# Install latest osm2pgsql # Install latest osm2pgsql
RUN mkdir -p /home/renderer/src \ RUN mkdir -p /home/renderer/src \
&& cd /home/renderer/src \ && cd /home/renderer/src \
&& git clone https://github.com/openstreetmap/osm2pgsql.git \ && git clone -b master https://github.com/openstreetmap/osm2pgsql.git --depth 1 \
&& cd /home/renderer/src/osm2pgsql \ && cd /home/renderer/src/osm2pgsql \
&& rm -rf .git \ && rm -rf .git \
&& mkdir build \ && mkdir build \
&& cd build \ && cd build \
&& cmake .. \ && cmake .. \
&& make -j $(nproc) \ && make -j $(nproc) \
&& make install \ && make -j $(nproc) install \
&& mkdir /nodes \ && mkdir /nodes \
&& chown renderer:renderer /nodes \ && chown renderer:renderer /nodes \
&& rm -rf /home/renderer/src/osm2pgsql && rm -rf /home/renderer/src/osm2pgsql
@@ -111,8 +110,9 @@ RUN mkdir -p /home/renderer/src \
# Install mod_tile and renderd # Install mod_tile and renderd
RUN mkdir -p /home/renderer/src \ RUN mkdir -p /home/renderer/src \
&& cd /home/renderer/src \ && cd /home/renderer/src \
&& git clone -b switch2osm https://github.com/SomeoneElseOSM/mod_tile.git \ && git clone -b switch2osm https://github.com/SomeoneElseOSM/mod_tile.git --depth 1 \
&& cd mod_tile \ && cd mod_tile \
&& rm -rf .git \
&& ./autogen.sh \ && ./autogen.sh \
&& ./configure \ && ./configure \
&& make -j $(nproc) \ && make -j $(nproc) \
@@ -124,8 +124,7 @@ RUN mkdir -p /home/renderer/src \
# Configure stylesheet # Configure stylesheet
RUN mkdir -p /home/renderer/src \ RUN mkdir -p /home/renderer/src \
&& cd /home/renderer/src \ && cd /home/renderer/src \
&& git clone https://github.com/gravitystorm/openstreetmap-carto.git \ && git clone --single-branch --branch v4.23.0 https://github.com/gravitystorm/openstreetmap-carto.git --depth 1 \
&& git -C openstreetmap-carto checkout v4.23.0 \
&& cd openstreetmap-carto \ && cd openstreetmap-carto \
&& rm -rf .git \ && rm -rf .git \
&& npm install -g carto@0.18.2 \ && npm install -g carto@0.18.2 \

View File

@@ -22,7 +22,7 @@ OSM2PGSQL_BIN=osm2pgsql
TRIM_BIN=/home/$ACCOUNT/src/regional/trim_osc.py TRIM_BIN=/home/$ACCOUNT/src/regional/trim_osc.py
DBNAME=gis DBNAME=gis
OSM2PGSQL_OPTIONS="-d $DBNAME -G --hstore ${OSM2PGSQL_EXTRA_ARGS} --tag-transform-script /home/renderer/src/openstreetmap-carto/openstreetmap-carto.lua --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/openstreetmap-carto.style" OSM2PGSQL_OPTIONS="-d $DBNAME -G --hstore --tag-transform-script /home/renderer/src/openstreetmap-carto/openstreetmap-carto.lua --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/openstreetmap-carto.style ${OSM2PGSQL_EXTRA_ARGS}"
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# When using trim_osc.py we can define either a bounding box (such as this # When using trim_osc.py we can define either a bounding box (such as this
@@ -113,7 +113,7 @@ if [ $# -eq 1 ] ; then
$OSMOSIS_BIN --read-replication-interval-init workingDirectory=$WORKOSM_DIR 1>&2 2> "$OSMOSISLOG" $OSMOSIS_BIN --read-replication-interval-init workingDirectory=$WORKOSM_DIR 1>&2 2> "$OSMOSISLOG"
wget "https://replicate-sequences.osm.mazdermind.de/?"$1"T00:00:00Z" -O $WORKOSM_DIR/state.txt wget "https://replicate-sequences.osm.mazdermind.de/?"$1"T00:00:00Z" -O $WORKOSM_DIR/state.txt
mv $WORKOSM_DIR/configuration.txt $WORKOSM_DIR/configuration_orig.txt mv $WORKOSM_DIR/configuration.txt $WORKOSM_DIR/configuration_orig.txt
sed "s!baseUrl=https://planet.openstreetmap.org/replication/minute!baseUrl=https://planet.openstreetmap.org/replication/minute!" $WORKOSM_DIR/configuration_orig.txt > $WORKOSM_DIR/configuration.txt sed "s!baseUrl=http://planet.openstreetmap.org/replication/minute!baseUrl=https://planet.openstreetmap.org/replication/minute!" $WORKOSM_DIR/configuration_orig.txt > $WORKOSM_DIR/configuration.txt
else else
# make sure the lockfile is removed when we exit and then claim it # make sure the lockfile is removed when we exit and then claim it

6
run.sh
View File

@@ -50,10 +50,10 @@ if [ "$1" = "import" ]; then
if [ -n "$DOWNLOAD_PBF" ]; then if [ -n "$DOWNLOAD_PBF" ]; then
echo "INFO: Download PBF file: $DOWNLOAD_PBF" echo "INFO: Download PBF file: $DOWNLOAD_PBF"
wget -nv "$DOWNLOAD_PBF" -O /data.osm.pbf wget "$WGET_ARGS" "$DOWNLOAD_PBF" -O /data.osm.pbf
if [ -n "$DOWNLOAD_POLY" ]; then if [ -n "$DOWNLOAD_POLY" ]; then
echo "INFO: Download PBF-POLY file: $DOWNLOAD_POLY" echo "INFO: Download PBF-POLY file: $DOWNLOAD_POLY"
wget -nv "$DOWNLOAD_POLY" -O /data.poly wget "$WGET_ARGS" "$DOWNLOAD_POLY" -O /data.poly
fi fi
fi fi
@@ -73,7 +73,7 @@ if [ "$1" = "import" ]; then
fi fi
# Import data # Import data
sudo -u renderer osm2pgsql -d gis --create --slim -G --hstore --tag-transform-script /home/renderer/src/openstreetmap-carto/openstreetmap-carto.lua --number-processes ${THREADS:-4} ${OSM2PGSQL_EXTRA_ARGS} -S /home/renderer/src/openstreetmap-carto/openstreetmap-carto.style /data.osm.pbf sudo -u renderer osm2pgsql -d gis --create --slim -G --hstore --tag-transform-script /home/renderer/src/openstreetmap-carto/openstreetmap-carto.lua --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/openstreetmap-carto.style /data.osm.pbf ${OSM2PGSQL_EXTRA_ARGS}
# Create indexes # Create indexes
sudo -u postgres psql -d gis -f indexes.sql sudo -u postgres psql -d gis -f indexes.sql