Offline maps in one compose file
One folder gives a map of a country you can search by address and route on, served from your machine: a base map from a PMTiles file, GridPin for the addresses, Valhalla for the routes. Once the data is fetched, nothing leaves the machine.
Fetch the data once
$ cd docker/offline-maps $ ./fetch.sh rs
The folder is docker/offline-maps of the GridPin repository. fetch.sh is the only step that goes online. It downloads the map libraries of the page at fixed versions and checks each by sha256, the fonts and icons of the map style, a PMTiles extract of the country from a daily Protomaps build, and the OpenStreetMap extract of the country from Geofabrik for the router. Countries with a box in the script: de, es, fr, it, mc, nl, rs; any other takes --bbox and --pbf.
Start it
$ docker compose up -d $ open http://127.0.0.1:8090
Type an address and press Find; a second address draws the car route between the two. A weak answer is drawn as a hollow circle with a note, and no route starts from it. The first start builds the routing tiles from the extract.
What it takes
| Monaco | Serbia | |
|---|---|---|
| Base map (PMTiles, zoom 0 to 14) | 1.6 MB | 302 MB |
| Routing data (extract and built tiles) | 10 MB | 701 MB |
| Memory in use: page, router, geocoder | 18, 87, 18 MB | 54, 181, 38 MB |
| First start, routing tiles built | seconds | about 12 minutes |
Measured on November 14, 2026, on a laptop with Docker Desktop. The three images together take about 1.1 GB. The GridPin image is built for linux/amd64; on Apple silicon Docker runs it under emulation.
No network at run time
The geocoder and the router sit on an internal Docker network: they cannot reach the internet. Only the web server publishes a port, on 127.0.0.1, and the page loads its scripts, fonts and tiles from it. The page asks /api/… of the geocoder and /route/… of the router, both through the same address.
Limits
- The base map and the routes are OpenStreetMap data (ODbL); the page credits it. GridPin's sheet is not, and nothing of OpenStreetMap goes into it.
- Protomaps keeps its daily builds for about 60 days:
BUILD=YYYYMMDD ./fetch.sh rspicks another. - A route by car to an address on a pedestrian street can fail; the page says so.
- One country per folder. For the geocoder alone, without the map: Docker.
The route endpoints: route to an address with Valhalla. The server: gridpin serve.