pmtiles-viewer
| Version | 2026.144.1443 |
| Repo | superproject |
Visual PMTiles archive inspector served as a static SPA on port 8001 (host 28001)
The protomaps/PMTiles TypeScript SPA — the same code deployed at
pmtiles.io — built from upstream source via npm at image build time
and served as a static Vite dist by python -m http.server on port
8001 (host 28001). Operators point it at any
/workspace/tiles/pmtiles/*.pmtiles archive (e.g. served by the
osm-tools martin tile server) to inspect its bbox, zoom range,
metadata, and tile contents in the browser. Verifiable: the Vite
build lands at /opt/pmtiles-viewer/build/index.html and the
supervisord service serves it over HTTP with root-relative assets.
Services
Section titled “Services”pmtiles-viewer
Acceptance plan
Section titled “Acceptance plan”This candy’s plan: — the runnable spec charly check executes against a live deployment. check: steps are idempotent probes; run: steps change state.
| Intent | Step |
|---|---|
run |
mkdir=/opt/pmtiles-viewer |
run |
command=set -euo pipefail # Clone shallow + the current tip of main. PMTiles has no # separately-released “viewer” tarball — source build of the # /app/ subdir is the canonical install. git clone –depth 1 https://github.com/protomaps/PMTiles /tmp/PMTiles cd /tmp/PMTiles/app # npm ci over npm install for deterministic resolution. # –no-audit + –no-fund trim ~5 sec of stderr chatter. npm ci –no-audit –no-fund # Vite (the build tool the PMTiles app uses) defaults to # –base=/ when the package.json build script doesn’t pin # it, but pass –base=/ explicitly to match the maputnik # layer’s lockdown — the asset-base-not-prefixed check below # locks the served HTML to root-relative asset URLs. Forward # the flag through npm via --. npm run build – –base=/ # Vite outputs to dist/ by default. Copy the SPA artifact # and error loudly if the upstream layout changes. if [ -d dist ]; then mkdir -p /opt/pmtiles-viewer cp -r dist /opt/pmtiles-viewer/build else echo “pmtiles-viewer build did not produce ./dist directory” >&2 ls -la exit 1 fi cd / rm -rf /tmp/PMTiles # Drop npm cache to shrink image. rm -rf /root/.npm |
check |
the Vite build artifact directory is present in the image |
check |
the SPA entry point index.html exists in the build artifact |
check |
the node toolchain that builds the SPA is installed |
agent-check |
the pmtiles-viewer service serves the built SPA over HTTP, answering GET / with status 200 and root-relative asset URLs that load in the browser |
check |
service=pmtiles-viewer |
check |
addr=127.0.0.1:${HOST_PORT:8001} |
check |
http=http://127.0.0.1:${HOST_PORT:8001}/ |
check |
command=! curl -fsS http://localhost:8001/ | grep -qE ‘“/(pmtiles|app)/’ |