update to debian trixie; postgres 18; fix cron; use tcmalloc
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:24.04@sha256:7c06e91f61fa88c08cc74f7e1b7c69ae24910d745357e0dfe1d2c0322aaf20f9 AS compiler-common
|
||||
FROM debian:trixie AS compiler-common
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
@@ -8,9 +8,9 @@ RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
ca-certificates gnupg lsb-release locales \
|
||||
wget curl \
|
||||
git-core unzip unrar postgresql-common \
|
||||
git-core unzip unrar-free postgresql-common \
|
||||
&& locale-gen $LANG && update-locale LANG=$LANG \
|
||||
&& /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -i -v 17\
|
||||
&& /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -i -v 18 \
|
||||
&& apt-get update && apt-get -y upgrade\
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
@@ -49,7 +49,7 @@ ENV AUTOVACUUM=on
|
||||
ENV UPDATES=disabled
|
||||
ENV REPLICATION_URL=https://planet.openstreetmap.org/replication/hour/
|
||||
ENV MAX_INTERVAL_SECONDS=3600
|
||||
ENV PG_VERSION=17
|
||||
ENV PG_VERSION=18
|
||||
|
||||
RUN ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" > /etc/timezone
|
||||
|
||||
@@ -84,6 +84,7 @@ RUN apt-get update \
|
||||
python3-shapely \
|
||||
python3-pip \
|
||||
renderd \
|
||||
libgoogle-perftools4 \
|
||||
sudo \
|
||||
vim \
|
||||
pipx \
|
||||
@@ -136,7 +137,7 @@ RUN chmod +x /usr/bin/openstreetmap-tiles-update-expire.sh \
|
||||
&& 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 "* * * * * renderer openstreetmap-tiles-update-expire.sh\n" >> /etc/crontab
|
||||
&& echo "* * * * * renderer openstreetmap-tiles-update-expire.sh" >> /etc/crontab
|
||||
|
||||
# Configure PosgtreSQL
|
||||
COPY postgresql.custom.conf.tmpl /etc/postgresql/$PG_VERSION/main/
|
||||
|
||||
@@ -14,5 +14,6 @@
|
||||
|
||||
<IfDefine ALLOW_CORS>
|
||||
Header set Access-Control-Allow-Origin "*"
|
||||
Header set Access-Control-Allow-Methods "GET, OPTIONS"
|
||||
</IfDefine>
|
||||
</VirtualHost>
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
[renderd]
|
||||
stats_file=/run/renderd/renderd.stats
|
||||
socketname=/run/renderd/renderd.sock
|
||||
num_threads=4
|
||||
num_threads=16
|
||||
tile_dir=/var/cache/renderd/tiles
|
||||
|
||||
[mapnik]
|
||||
plugins_dir=/usr/lib/mapnik/3.1/input
|
||||
plugins_dir=/usr/lib/x86_64-linux-gnu/mapnik/4.0/input
|
||||
font_dir=/usr/share/fonts
|
||||
font_dir_recurse=true
|
||||
|
||||
|
||||
10
run.sh
10
run.sh
@@ -188,24 +188,28 @@ if [ "$1" == "run" ]; then
|
||||
# Configure renderd threads
|
||||
sed -i -E "s/num_threads=[0-9]+/num_threads=${THREADS:-4}/g" /etc/renderd.conf
|
||||
|
||||
cronPID=0
|
||||
# start cron job to trigger consecutive updates
|
||||
if [ "${UPDATES:-}" == "enabled" ] || [ "${UPDATES:-}" == "1" ]; then
|
||||
printenv > /etc/environment
|
||||
/etc/init.d/cron start
|
||||
cron &
|
||||
cronPID=$!
|
||||
sudo -u renderer touch /var/log/tiles/run.log; tail -f /var/log/tiles/run.log >> /proc/1/fd/1 &
|
||||
sudo -u renderer touch /var/log/tiles/osmosis.log; tail -f /var/log/tiles/osmosis.log >> /proc/1/fd/1 &
|
||||
sudo -u renderer touch /var/log/tiles/expiry.log; tail -f /var/log/tiles/expiry.log >> /proc/1/fd/1 &
|
||||
sudo -u renderer touch /var/log/tiles/osm2pgsql.log; tail -f /var/log/tiles/osm2pgsql.log >> /proc/1/fd/1 &
|
||||
|
||||
fi
|
||||
|
||||
# Run while handling docker stop's SIGTERM
|
||||
stop_handler() {
|
||||
kill -TERM "$child"
|
||||
if [ $cronPID -gt 0 ] ; then
|
||||
kill -TERM "$cronPID"
|
||||
fi
|
||||
}
|
||||
trap stop_handler SIGTERM
|
||||
|
||||
sudo -u renderer renderd -f -c /etc/renderd.conf &
|
||||
sudo LD_PRELOAD=libtcmalloc.so.4 -u renderer renderd -f -c /etc/renderd.conf &
|
||||
child=$!
|
||||
wait "$child"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user