https://github.com/mediacomem/mbtileserver
A server for map tiles stored in mbtiles format, with auto-reload
https://github.com/mediacomem/mbtileserver
Last synced: 4 months ago
JSON representation
A server for map tiles stored in mbtiles format, with auto-reload
- Host: GitHub
- URL: https://github.com/mediacomem/mbtileserver
- Owner: MediaComem
- License: mit
- Created: 2020-08-12T14:31:26.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-02-01T08:41:48.000Z (over 4 years ago)
- Last Synced: 2025-07-19T15:52:04.759Z (11 months ago)
- Language: Dockerfile
- Size: 9.77 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# mbtileserver
A server for map tiles in the [mbtiles](https://github.com/mapbox/mbtiles-spec)
format, based on
[consbio/mbtileserver](https://github.com/consbio/mbtileserver/) with an
additional cron job to automatically reload the tiles on changes.
## Usage
This repository provides a [Docker
image](https://hub.docker.com/r/mediacomem/mbtileserver) which extends the
existing [consbio/mbtileserver](https://hub.docker.com/r/consbio/mbtileserver)
image. Any settings used with that original image can also be used with this
one.
In addition to the mbtileserver, the image runs a cron job which runs every
minute and checks the tile directory (defined by the `$TILE_DIR` environment
variable) for changes to the tiles. If any change is detected, the script will
send a SIGHUP signal to the mbtileserver, causing it to reload the new tiles.
## Configuration
The mbtileserver is always launched with the `--enable-reload-signal` option,
since it must be able to receive the signal from the cron job. You may specify
additional command-line arguments with the `$MBTILESERVER_ARGS` environment
variable.
### Change detection mode
The `$TILE_VERSION_TYPE` environment variable determines how changes to the
tiles are detected:
* If it is `date` (the default), the script will check the paths of all
`.mbtiles` files in the tiles directory, as well as their last modification
times. Moving or changing the last modification time of any of these files
will trigger a reload.
* If it is `digest`, the script will check the paths of all `.mbtiles` files in
the tiles directory, as well as the SHA-256 hash of their contents. Moving or
modifying the contents of any of these files will trigger a reload.
This mode is more CPU-intensive but checks the actual contents of the files,
not only their last modification time.
### Persistence
The script run by the cron job will save the latest "version" of the tiles in
the directory defined by the `$TILE_VERSION_DIR` environment variable for future
comparison. This directory is `/var/lib/mbtiles-version` by default.
You may store this directory in a Docker volume to avoid an extra check of the
tiles when the container restarts. This is recommended when using `digest` mode.