Skip to content

Commit 6e5f4f4

Browse files
committed
Add proper handling of docker stop
1 parent ca4b1ac commit 6e5f4f4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ docker run \
6363
run
6464
```
6565

66+
**If you do this, then make sure to also run the import with the `openstreetmap-rendered-tiles` volume to make sure that caching works properly across updates!**
67+
6668
### Enabling automatic updating (optional)
6769

6870
Given that you've specified both the OSM data and polygon as specified in the *Automatic updates* section during server setup, you can enable the updating process by setting the variable `UPDATES` to `enabled`:

run.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,16 @@ if [ "$1" = "run" ]; then
9595
/etc/init.d/cron start
9696
fi
9797

98-
# Run
99-
sudo -u renderer renderd -f -c /usr/local/etc/renderd.conf
98+
# Run while handling docker stop's SIGTERM
99+
stop_handler() {
100+
kill -TERM "$child"
101+
}
102+
trap stop_handler SIGTERM
103+
104+
sudo -u renderer renderd -f -c /usr/local/etc/renderd.conf &
105+
child=$!
106+
wait "$child"
107+
100108
service postgresql stop
101109

102110
exit 0

0 commit comments

Comments
 (0)