From 8b1976b9904e671ca309690815c0ce63f20bb600 Mon Sep 17 00:00:00 2001 From: acalcutt Date: Mon, 7 Nov 2022 09:17:27 -0500 Subject: [PATCH 1/3] change docker to use default 8080 port --- Dockerfile | 2 +- Dockerfile_light | 2 +- README.md | 6 +++--- docker-entrypoint.sh | 2 +- docker-entrypoint_light.sh | 2 +- docs/installation.rst | 2 +- run.sh | 2 +- src/healthcheck.js | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8460f4619..0e4808e5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,7 +76,7 @@ RUN mkdir -p /data && chown node:node /data VOLUME /data WORKDIR /data -EXPOSE 80 +EXPOSE 8080 USER node:node diff --git a/Dockerfile_light b/Dockerfile_light index ed488ef61..f2ea8e426 100644 --- a/Dockerfile_light +++ b/Dockerfile_light @@ -20,7 +20,7 @@ RUN set -ex; \ apt-get clean; \ rm -rf /var/lib/apt/lists/*; -EXPOSE 80 +EXPOSE 8080 RUN mkdir -p /data && chown node:node /data VOLUME /data diff --git a/README.md b/README.md index 971250ad9..45c296a9c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ An alternative to npm to start the packed software easier is to install [Docker] Example using a mbtiles file ```bash wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/zurich_switzerland.mbtiles -docker run --rm -it -v $(pwd):/data -p 8080:80 maptiler/tileserver-gl --mbtiles zurich_switzerland.mbtiles +docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl --mbtiles zurich_switzerland.mbtiles [in your browser, visit http://[server ip]:8080] ``` @@ -52,13 +52,13 @@ Example using a config.json + style + mbtiles file ```bash wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip unzip test_data.zip -docker run --rm -it -v $(pwd):/data -p 8080:80 maptiler/tileserver-gl +docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl [in your browser, visit http://[server ip]:8080] ``` Example using a different path ```bash -docker run --rm -it -v /your/local/config/path:/data -p 8080:80 maptiler/tileserver-gl +docker run --rm -it -v /your/local/config/path:/data -p 8080:8080 maptiler/tileserver-gl ``` replace '/your/local/config/path' with the path to your config file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b4defe633..72eae4e5b 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -20,7 +20,7 @@ trap refresh HUP if ! which -- "${1}"; then # first arg is not an executable - xvfb-run -a --server-args="-screen 0 1024x768x24" -- node /usr/src/app/ -p 80 "$@" & + xvfb-run -a --server-args="-screen 0 1024x768x24" -- node /usr/src/app/ "$@" & # Wait exits immediately on signals which have traps set. Store return value and wait # again for all jobs to actually complete before continuing. wait $! || RETVAL=$? diff --git a/docker-entrypoint_light.sh b/docker-entrypoint_light.sh index e3c1c6778..33ec837ea 100644 --- a/docker-entrypoint_light.sh +++ b/docker-entrypoint_light.sh @@ -20,7 +20,7 @@ trap refresh HUP if ! which -- "${1}"; then # first arg is not an executable - node /usr/src/app/ -p 80 "$@" & + node /usr/src/app/ "$@" & # Wait exits immediately on signals which have traps set. Store return value and wait # again for all jobs to actually complete before continuing. wait $! || RETVAL=$? diff --git a/docs/installation.rst b/docs/installation.rst index 232ca7ad7..058b32066 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -7,7 +7,7 @@ Docker When running docker image, no special installation is needed -- the docker will automatically download the image if not present. -Just run ``docker run --rm -it -v $(pwd):/data -p 8080:80 maptiler/tileserver-gl``. +Just run ``docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl``. Additional options (see :doc:`/usage`) can be passed to the TileServer GL by appending them to the end of this command. You can, for example, do the following: diff --git a/run.sh b/run.sh index 26cdab853..5f9453dac 100755 --- a/run.sh +++ b/run.sh @@ -29,7 +29,7 @@ export DISPLAY=:${displayNumber}.${screenNumber} echo cd /data -node /usr/src/app/ -p 80 "$@" & +node /usr/src/app/ "$@" & child=$! wait "$child" diff --git a/src/healthcheck.js b/src/healthcheck.js index 11d11f9ad..fdaf50206 100644 --- a/src/healthcheck.js +++ b/src/healthcheck.js @@ -2,7 +2,7 @@ import * as http from 'http'; var options = { timeout: 2000, }; -var url = "http://localhost:80/health"; +var url = "http://localhost:8080/health"; var request = http.request(url, options, (res) => { console.log(`STATUS: ${res.statusCode}`); if (res.statusCode == 200) { From 528b402d60ad4ceee05d25031a3d61dae2b73a8e Mon Sep 17 00:00:00 2001 From: acalcutt Date: Tue, 8 Nov 2022 22:39:16 -0500 Subject: [PATCH 2/3] change port for npm run docker --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ff4beaeb1..2bb07d850 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "scripts": { "test": "mocha test/**.js --timeout 10000", - "docker": "docker build -f Dockerfile . && docker run --rm -i -p 8080:80 $(docker build -q .)" + "docker": "docker build -f Dockerfile . && docker run --rm -i -p 8080:8080 $(docker build -q .)" }, "dependencies": { "@mapbox/glyph-pbf-composite": "0.0.3", From 5be6300e6331ab7db4c80dd895671698795fe900 Mon Sep 17 00:00:00 2001 From: acalcutt Date: Sun, 20 Nov 2022 22:31:55 -0500 Subject: [PATCH 3/3] update version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d0857d3e9..73d821ede 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tileserver-gl", - "version": "4.1.3", + "version": "4.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "tileserver-gl", - "version": "4.1.3", + "version": "4.2.0", "license": "BSD-2-Clause", "dependencies": { "@mapbox/glyph-pbf-composite": "0.0.3", diff --git a/package.json b/package.json index 3c7ce7b00..5b47c8081 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tileserver-gl", - "version": "4.1.3", + "version": "4.2.0", "description": "Map tile server for JSON GL styles - vector and server side generated raster tiles", "main": "src/main.js", "bin": "src/main.js",