maptiler / tileserver-gl

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
https://tileserver.readthedocs.io/en/latest/
Other
2.23k stars 638 forks source link

I need to create a new Style in a docker version #700

Closed heyjoja closed 1 year ago

heyjoja commented 1 year ago

Hi, I install the dockerized version maptiler/tileserver-gl from the docker hub, someone can help me with a documentation or any reference about how create a new style with x/y/z on docker because I don't understand where is saved the config.json

acalcutt commented 1 year ago

In the command docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl the "$(pwd)" is the local path where your config and styles would go. If you leave it $(pwd) it is whatever folder you run the command from. You can also change it to a real local path. for example, if your config files are in /opt/tileserver you could put /opt/tileserver:/data

For what to put into the config, take a look at the test file https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip , which shows how you would lay out the config and style folders.

In the example on the main page you can see it just downloads this file, extracts it to the local folder, and starts tileserver. when tileserver starts it sees the config.json in the directory and uses that.

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:8080 maptiler/tileserver-gl
[in your browser, visit http://[server ip]:8080]

Edit: you could also likely add something like "-c /data/custom-config-name.json" to the end of the docker command if you wanted to specify a different config name (note the path inside the docker starts with /data)

heyjoja commented 1 year ago

Works, thank you so much, I deployed using Microsoft azure and work perfectly

acalcutt commented 1 year ago

Good to hear 👍 I'll close this issue.