Previous: Running the Application with docker-compose, Up: Running the Application with docker-compose [Contents][Index]
Two other docker-compose
files can be used to create a map tile server
using the Docker
container for OpenStreetMap tile server
One imports the OpenStreetMap data. The other runs the tile server after the data has been imported.
Elevation data can be made available to the container as follows:
$ docker volume create elevation-data
$ tar -zcf elevation-data.tar.gz *.tif $ CID=$(docker run -d -v \ elevation-data:/elevation-data busybox true) $ cat elevation-data.tar.gz | docker cp - $CID:/elevation-data/ $ docker container stop $CID $ docker container rm $CID
It is necessary to use the tar file method as that seems the only way to copy the data to the root of the volume.
Import map tile data as follows:
$ sudo dd if=/dev/zero of=/swap bs=1G count=2 $ sudo chmod 0600 /swap $ sudo mkswap /swap $ sudo swapon /swap
$ docker volume create osm-data $ docker volume create osm-tiles
The default set in ./.env
imports OSM data for Monaco. To import
another region,
e.g. the
Isle of Man, override the environment variables in ./.env
, e.g.:
The run the import with:
$ DOWNLOAD_PBF=\ https://download.geofabrik.de/europe/isle-of-man-latest.osm.pbf \ DOWNLOAD_POLY=\ https://download.geofabrik.de/europe/isle-of-man.poly \ docker compose -f docker-compose-map-import.yml up
The process must complete without error. Check the final output carefully.
If it fails, it is necessary to delete and re-create the Docker
osm-data
volume.
$ docker volume rm osm-data $ docker volume create osm-data
$ docker compose -f docker-compose-map-server.yml up -d
To stop the tile server:
$ docker compose -f docker-compose-map-server.yml down