Skip to main content

Deploy the server in a container

Use this procedure to run the native Mailwoman HTTP server from the published container image, ghcr.io/sister-software/mailwoman. The image installs the published packages at its tag's version and includes the model weightsmodel weightsThe learned parameters of the neural classifier, shipped as ONNX files in the @mailwoman/neural-weights-* packages. Weights are locale-specific bundles that include the model, tokenizer, and a model-card.json metadata file.. You mount the geographic data into it read-only.

Each release publishes an image tagged with its version, such as 11.2.0, and moves latest to it. The commands below were run with Podman. Docker accepts the same pull and run arguments.

Prerequisites​

  • Podman or Docker on linux/amd64. The image is published for that platform only, because the onnxruntime-node dependency ships prebuilt glibc x64 binaries.
  • A data root populated with mailwoman data pull. Install, check, roll back and prune local data covers the pull.

1. Pull the data​

The example installs the global place candidates and the Washington, DC address pointssitus dataA dataset of exact address-point coordinates (rooftop-level). Mailwoman's geocoder uses a national situs layer (124.9M US points built from state address-point sources) as the highest-precision tier of the geocode cascade. into a data root of its own:

sh
npx mailwoman data pull candidate --data-root ./mailwoman-data
npx mailwoman data pull us --only dc --data-root ./mailwoman-data

--only filters every bundleevidence bundleThe pair of retrieval-augmented input channels (street-type + locality-surface) that feed lexicon membership as soft per-token evidence alongside the text. Shipped in 6.7.0; trained natively from step 0 in the from-scratch base line. in the same command, so the candidate bundleevidence bundleThe pair of retrieval-augmented input channels (street-type + locality-surface) that feed lexicon membership as soft per-token evidence alongside the text. Shipped in 6.7.0; trained natively from step 0 in the from-scratch base line. is pulled on its own. On the host used for this page, the candidate pull took 672 s and the DC pull took 23 s.

2. Pull the image​

sh
podman pull ghcr.io/sister-software/mailwoman:11.2.0

The image measured 1.09 GB. It runs as the unprivileged node user, reads its data from /data, and serves the native /v1 API on port 3000.

3. Run the container with read-only data​

Mount the data root read-only at /data:

sh
podman run -d --name mailwoman -p 127.0.0.1:3000:3000 \
-v "$PWD/mailwoman-data":/data:ro \
ghcr.io/sister-software/mailwoman:11.2.0

The server reads the pull's selection from the data root and found the candidate database without any other setting:

text
[mailwoman] gazetteer found — /v1/geocode + /v1/batch enabled (data root: /data)
[mailwoman] native /v1 API listening on http://0.0.0.0:3000

A container started without data keeps running and parsesaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates. addresses, and its /v1/geocode and /v1/batch endpoints answer 503. Its log states the cause:

text
[mailwoman] no gazetteer at /data — booting parse-only (/v1/geocode + /v1/batch answer 503).

A symbolic link inside the mounted directory must point to a path that also exists inside the container. A link to a host path appears missing inside the container.

:ro works with the published data files. The published DC and US Virgin Islands address-point files use SQLite's rollback journal, and the server opened them read-only. A database in write-ahead-log (WAL) mode needs its -shm file to be read from a read-only mount. On the host used for this page, a locally built DC file in WAL mode answered at the admin tier instead of address_point, with no error. If you build your own data, check that each file uses a rollback journal before mounting it read-only.

4. Check readiness​

sh
curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1:3000/health
text
200

A 200 from /health means the server answered, and a container without data answers it too. Send one known address after each deployment to check that geocodinggeocodingThe process of converting an address into geographic coordinates (latitude and longitude). Mailwoman geocodes in a multi-tier cascade: exact address-point match → street interpolation → locality centroid. Each tier is progressively coarser but more widely available. reaches the address pointssitus dataA dataset of exact address-point coordinates (rooftop-level). Mailwoman's geocoder uses a national situs layer (124.9M US points built from state address-point sources) as the highest-precision tier of the geocode cascade.:

sh
curl -s -X POST http://127.0.0.1:3000/v1/geocode -H "content-type: application/json" -d '{"address":"1600 Pennsylvania Ave NW, Washington, DC 20500"}'

The container returned "resolution_tier":"address_point" with "coordinate_source":{"source":"overture:NAD","release":"2026-05-20.0"}. A 503 means the server found no gazetteergazetteerA geographical index that maps place names and postcodes to real-world coordinates. Mailwoman uses a custom-built Who's On First (WOF) SQLite database as its gazetteer — the 'atlas' half of the grammar/atlas architecture. under /data. A result at the admin tier for an address your data covers means the server didn't read the address pointssitus dataA dataset of exact address-point coordinates (rooftop-level). Mailwoman's geocoder uses a national situs layer (124.9M US points built from state address-point sources) as the highest-precision tier of the geocode cascade.. Run the Mailwoman HTTP server shows complete responses.

The image declares a HEALTHCHECK that requests /health every 30 seconds after a 60-second start period, and marks the container unhealthy after 3 failed requests. An orchestrator that ignores image health checks, such as Kubernetes, needs the same check defined as a probe.

5. Size the container​

After one geocode, podman stats reported 383.9 MB of memory for the running container. It's one measurement on one Linux host, so allow headroom and measure under your own load. Data files are read from the mount rather than copied, so disk use inside the container stays at the image size.

Run a compatible server or build your own image​

The image also installs the Nominatim, Photon and libpostallibpostalAn open-source C address parser used by Pelias. Mailwoman's rule-based v0 and neural classifier supersede it. servers. To run one, override the command, for example with node node_modules/@mailwoman/nominatim/out/cli/main.js. The repository's Dockerfile lists each server's command and port, and docker/docker-compose.yml runs them. To build an image from a checkout, run podman build --build-arg MAILWOMAN_VERSION=11.2.0 -t mailwoman:11.2.0 . at the repository root.

Not covered​

A serverless deployment wasn't tested, and neither were the compatibility servers in a container. Point a Nominatim, Photon or libpostal client at Mailwoman gives each server's command. Choose a deployment compares the library, browser and server options.