openmaptiles

Openmaptiles-server on Docker - Config


I'm trying to customise OpenMaptiles-Server running under Docker. I've NO docker exposure. I've read the docs and they suggest there is a config file for Docker, but what its name is, where it lives seems to be assumed knowledge. Is there a blog that explains this for absolute novices as the documentation from Klokantech is not very helpful if you have not used these technologies before. Can somebody let me know where the configuration file lives, what its name is supposed to be and how I get rid of the error about unconfigured /data directory? thanks


Solution

  • Assuming you mean the docker image at klokantech/openmaptiles-server, the method for configuration is as follows:

    1. Pull the image.
    2. Run the image - expose a local port you can connect to, and bind-mount a local path to the image at /data
    3. Run a browser and connect to the container host at the specified port. A 'first time install' interface will come up allowing you select what regions you want to download mbtile data for. Note that you can only run 1 mbtile per server - it will render 'blank' (tan) tiles for everything outside that region. Allow the container server to download the tiles.
    4. Inspect the local path that was mounted to the container at /data. You should now see a .mbtiles and a config.json file. Save those off somewhere for posterity.
    5. In the actual location you intend to now run the container, deploy the image, the mbtiles, and the config.json. Put the mbtiles and config.json in the same local directory, and bind mount those to /data when you run the openmap-tileserver. It will pick up on the existing mbtiles and config, skipping the install step, and boot straight into serving the tiles.