Previous: , Up: Running the Application with docker-compose   [Contents][Index]


8.2.2.1 OpenStreetMap Tile Server

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.

It is unlikely there would be sufficient memory or disk space in the Vagrant VM to run the Tile Server. It would be best to use a dedicated server for this process.

  1. The import process temporarily requires a lot of memory. You may need to create and mount a swap file:
    $ sudo dd if=/dev/zero of=/swap bs=1G count=2
    $ sudo chmod 0600 /swap
    $ sudo mkswap /swap
    $ sudo swapon /swap
    
  2. Create Docker volumes for storing the database and caching map tiles:
    $ docker volume create osm-data
    $ docker volume create osm-tiles
    
  3. It is recommended to use a small region to minimise resource usage.

    Import OSM data for Monaco:

    $ docker compose -f docker-compose-map-import.yaml 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
    
  4. Once the import completes successfully, run the map tile server:
    $ docker compose -f docker-compose-map-server.yml up -d
    

    To stop the tile server:

    $ docker compose -f docker-compose-map-server.yml down