Compare commits

..

7 Commits

Author SHA1 Message Date
Ivan Vazhenin
5d5be67efc fix 2022-04-12 19:50:29 +03:00
Petr Sloup
aba60f0c6a Merge pull request #560 from zstadler/docker-reload
Simplify reloading the configuration with docker
2021-12-29 09:42:16 +01:00
zstadler
6027d89623 Simplify reloading the configuration with docker
Allow `docker kill -s HUP` and `docker-compose kill -s HUP` to reach the
node process.
2021-12-22 18:38:44 +02:00
Petr Sloup
8680a8006a Merge pull request #516 from zstadler/patch-1
Document configuration reloading when using docker
2021-07-28 13:14:31 +02:00
zstadler
09ded526ef Document configuration reloading when using docker
Based on https://github.com/maptiler/tileserver-gl/issues/420#issuecomment-766332814
2021-02-02 12:35:19 +02:00
Petr Sloup
c89a5ae029 v3.1.1 2020-12-14 15:27:33 +01:00
Petr Sloup
a3d7f8bcbd Fix the docker image port to fix backward compatibility (#502) 2020-12-14 15:27:05 +01:00
5 changed files with 26 additions and 5 deletions

View File

@@ -46,10 +46,10 @@ ENV CHOKIDAR_INTERVAL=500
VOLUME /data VOLUME /data
WORKDIR /data WORKDIR /data
EXPOSE 8000 EXPOSE 80
USER node:node USER node:node
ENTRYPOINT ["/app/docker-entrypoint.sh"] ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["-p", "8000"] CMD ["-p", "80"]

View File

@@ -10,6 +10,14 @@ handle() {
trap handle INT TERM trap handle INT TERM
refresh() {
SIGNAL=$(( $? - 128 ))
echo "Caught signal ${SIGNAL}, refreshing"
kill -s ${SIGNAL} $(pidof node) 2>/dev/null
}
trap refresh HUP
if ! which -- "${1}"; then if ! which -- "${1}"; then
# first arg is not an executable # first arg is not an executable
xvfb-run -a --server-args="-screen 0 1024x768x24" -- node /app/ "$@" & xvfb-run -a --server-args="-screen 0 1024x768x24" -- node /app/ "$@" &

View File

@@ -29,8 +29,10 @@ Default preview style and configuration
- If no configuration file is specified, a default preview style (compatible with openmaptiles) is used. - If no configuration file is specified, a default preview style (compatible with openmaptiles) is used.
- If no mbtiles file is specified (and is not found in the current working directory), a sample file is downloaded (showing the Zurich area) - If no mbtiles file is specified (and is not found in the current working directory), a sample file is downloaded (showing the Zurich area)
Reloading configuration Reloading the configuration
====== ======
It is possible to reload the configuration file without restarting the whole process by sending a SIGHUP signal to the node process. It is possible to reload the configuration file without restarting the whole process by sending a SIGHUP signal to the node process.
However, this does not currently work when running the tileserver-gl docker container (the signal is not passed to the subprocess, see https://github.com/maptiler/tileserver-gl/issues/420#issuecomment-597507663).
- The `docker kill -s HUP tileserver-gl` command can be used when running the tileserver-gl docker container.
- The `docker-compose -s HUP tileserver-gl-service-name` can be used when tileserver-gl is run as a docker-compose service.

View File

@@ -1,6 +1,6 @@
{ {
"name": "tileserver-gl", "name": "tileserver-gl",
"version": "3.1.0", "version": "3.1.1",
"description": "Map tile server for JSON GL styles - vector and server side generated raster tiles", "description": "Map tile server for JSON GL styles - vector and server side generated raster tiles",
"main": "src/main.js", "main": "src/main.js",
"bin": "src/main.js", "bin": "src/main.js",

View File

@@ -256,6 +256,17 @@ function start(opts) {
res.send(result); res.send(result);
}); });
app.get('/process', (req, res, next) => {
const result = {};
const id = req.query.style || '';
const item = {
'style': id + '.json'
};
result[id] = true;
addStyle(id, item, true, true);
res.send(serving.styles);
});
const addTileJSONs = (arr, req, type) => { const addTileJSONs = (arr, req, type) => {
for (const id of Object.keys(serving[type])) { for (const id of Object.keys(serving[type])) {
const info = clone(serving[type][id].tileJSON); const info = clone(serving[type][id].tileJSON);