change docker to use port 8080 by default (#638)
* change docker to use default 8080 port
This commit is contained in:
parent
0346d5c304
commit
c134795b81
10 changed files with 14 additions and 14 deletions
|
@ -76,7 +76,7 @@ RUN mkdir -p /data && chown node:node /data
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 8080
|
||||||
|
|
||||||
USER node:node
|
USER node:node
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ RUN set -ex; \
|
||||||
apt-get clean; \
|
apt-get clean; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 8080
|
||||||
|
|
||||||
RUN mkdir -p /data && chown node:node /data
|
RUN mkdir -p /data && chown node:node /data
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
|
|
|
@ -44,7 +44,7 @@ An alternative to npm to start the packed software easier is to install [Docker]
|
||||||
Example using a mbtiles file
|
Example using a mbtiles file
|
||||||
```bash
|
```bash
|
||||||
wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/zurich_switzerland.mbtiles
|
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]
|
[in your browser, visit http://[server ip]:8080]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -52,13 +52,13 @@ Example using a config.json + style + mbtiles file
|
||||||
```bash
|
```bash
|
||||||
wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip
|
wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip
|
||||||
unzip 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]
|
[in your browser, visit http://[server ip]:8080]
|
||||||
```
|
```
|
||||||
|
|
||||||
Example using a different path
|
Example using a different path
|
||||||
```bash
|
```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
|
replace '/your/local/config/path' with the path to your config file
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ 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 /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
|
# Wait exits immediately on signals which have traps set. Store return value and wait
|
||||||
# again for all jobs to actually complete before continuing.
|
# again for all jobs to actually complete before continuing.
|
||||||
wait $! || RETVAL=$?
|
wait $! || RETVAL=$?
|
||||||
|
|
|
@ -20,7 +20,7 @@ trap refresh HUP
|
||||||
|
|
||||||
if ! which -- "${1}"; then
|
if ! which -- "${1}"; then
|
||||||
# first arg is not an executable
|
# 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
|
# Wait exits immediately on signals which have traps set. Store return value and wait
|
||||||
# again for all jobs to actually complete before continuing.
|
# again for all jobs to actually complete before continuing.
|
||||||
wait $! || RETVAL=$?
|
wait $! || RETVAL=$?
|
||||||
|
|
|
@ -7,7 +7,7 @@ Docker
|
||||||
|
|
||||||
When running docker image, no special installation is needed -- the docker will automatically download the image if not present.
|
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:
|
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:
|
||||||
|
|
||||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "tileserver-gl",
|
"name": "tileserver-gl",
|
||||||
"version": "4.1.3",
|
"version": "4.2.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "tileserver-gl",
|
"name": "tileserver-gl",
|
||||||
"version": "4.1.3",
|
"version": "4.2.0",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mapbox/glyph-pbf-composite": "0.0.3",
|
"@mapbox/glyph-pbf-composite": "0.0.3",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "tileserver-gl",
|
"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",
|
"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",
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
"lint:eslint:fix": "eslint --fix \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-path .gitignore",
|
"lint:eslint:fix": "eslint --fix \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-path .gitignore",
|
||||||
"lint:prettier": "prettier --check \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs,json}\" --ignore-path .gitignore",
|
"lint:prettier": "prettier --check \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs,json}\" --ignore-path .gitignore",
|
||||||
"lint:prettier:fix": "prettier --write \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs,json}\" --ignore-path .gitignore",
|
"lint:prettier:fix": "prettier --write \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs,json}\" --ignore-path .gitignore",
|
||||||
"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 .)",
|
||||||
"prepare": "node -e \"if (process.env.NODE_ENV !== 'production'){ process.exit(1) } \" || husky install"
|
"prepare": "node -e \"if (process.env.NODE_ENV !== 'production'){ process.exit(1) } \" || husky install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
2
run.sh
2
run.sh
|
@ -29,7 +29,7 @@ export DISPLAY=:${displayNumber}.${screenNumber}
|
||||||
|
|
||||||
echo
|
echo
|
||||||
cd /data
|
cd /data
|
||||||
node /usr/src/app/ -p 80 "$@" &
|
node /usr/src/app/ "$@" &
|
||||||
child=$!
|
child=$!
|
||||||
wait "$child"
|
wait "$child"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import * as http from 'http';
|
||||||
var options = {
|
var options = {
|
||||||
timeout: 2000,
|
timeout: 2000,
|
||||||
};
|
};
|
||||||
var url = 'http://localhost:80/health';
|
var url = 'http://localhost:8080/health';
|
||||||
var request = http.request(url, options, (res) => {
|
var request = http.request(url, options, (res) => {
|
||||||
console.log(`STATUS: ${res.statusCode}`);
|
console.log(`STATUS: ${res.statusCode}`);
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
|
|
Loading…
Reference in a new issue