This commit is contained in:
Greg 2021-12-20 17:38:41 +00:00
parent 89d238b2d0
commit 6d2eaa23a5
4 changed files with 9 additions and 3 deletions

View File

@ -161,6 +161,8 @@ RUN chmod +x /usr/bin/openstreetmap-tiles-update-expire \
&& mkdir /var/log/tiles \
&& chmod a+rw /var/log/tiles \
&& ln -s /home/renderer/src/mod_tile/osmosis-db_replag /usr/bin/osmosis-db_replag \
&& echo "SHELL=/bin/bash" > /etc/crontab \
&& echo "BASH_ENV=/container.env" >> /etc/crontab \
&& echo "* * * * * renderer openstreetmap-tiles-update-expire\n" >> /etc/crontab
RUN mkdir /nodes \

View File

@ -30,9 +30,11 @@ If your import is an extract of the planet and has polygonal bounds associated w
docker run \
-e UPDATES=enabled \
-e REPLICATION_URL=https://planet.openstreetmap.org/replication/minute/ \
-e MAX_INTERVAL_SECONDS=60 \
-v /absolute/path/to/luxembourg.osm.pbf:/data.osm.pbf \
-v /absolute/path/to/luxembourg.poly:/data.poly \
-v openstreetmap-data:/var/lib/postgresql/12/main \
-v openstreetmap-rendered-tiles:/var/lib/mod_tile \
overv/openstreetmap-tile-server \
import
```
@ -94,6 +96,7 @@ Given that you've set up your import as described in the *Automatic updates* sec
docker run \
-p 8080:80 \
-e REPLICATION_URL=https://planet.openstreetmap.org/replication/minute/ \
-e MAX_INTERVAL_SECONDS=60 \
-e UPDATES=enabled \
-v openstreetmap-data:/var/lib/postgresql/12/main \
-v openstreetmap-rendered-tiles:/var/lib/mod_tile \

View File

@ -30,7 +30,6 @@ OSM2PGSQL_OPTIONS="-d $DBNAME -G --hstore --tag-transform-script /home/renderer/
#------------------------------------------------------------------------------
TRIM_POLY_FILE="/var/lib/mod_tile/data.poly"
TRIM_OPTIONS="-d $DBNAME"
#TRIM_REGION_OPTIONS="-b -14.17 48.85 2.12 61.27"
TRIM_REGION_OPTIONS="-p $TRIM_POLY_FILE"
BASE_DIR=/var/lib/mod_tile
@ -116,7 +115,7 @@ if [ $# -eq 1 ] ; then
cat > /var/lib/mod_tile/.osmosis/configuration.txt <<- EOM
baseURL=$REPLICATION_URL
maxInterval=86400
maxInterval=$MAX_INTERVAL_SECONDS
EOM
else

4
run.sh
View File

@ -2,6 +2,8 @@
set -euo pipefail
declare -p | grep -Ev 'BASHOPTS|BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID' > /container.env
function createPostgresConfig() {
cp /etc/postgresql/12/main/postgresql.custom.conf.tmpl /etc/postgresql/12/main/conf.d/postgresql.custom.conf
sudo -u postgres echo "autovacuum = $AUTOVACUUM" >> /etc/postgresql/12/main/conf.d/postgresql.custom.conf
@ -66,7 +68,7 @@ if [ "$1" = "import" ]; then
REPLICATION_TIMESTAMP=$(cat /var/lib/mod_tile/replication_timestamp.txt)
# initial setup of osmosis workspace (for consecutive updates)
sudo -u renderer openstreetmap-tiles-update-expire $REPLICATION_TIMESTAMP
sudo -E -u renderer openstreetmap-tiles-update-expire $REPLICATION_TIMESTAMP
fi