Skip to content

✨ Docker configuration for nominatim#327

Open
madmath03 wants to merge 5 commits intoProject-OSRM:gh-pagesfrom
Monogramm:feat/nominatim
Open

✨ Docker configuration for nominatim#327
madmath03 wants to merge 5 commits intoProject-OSRM:gh-pagesfrom
Monogramm:feat/nominatim

Conversation

@madmath03
Copy link
Copy Markdown
Contributor

@madmath03 madmath03 commented Oct 5, 2020

✨ Docker configuration for nominatim

Closes #313 and closes #314 and closes #283.

Copy link
Copy Markdown

@akashihi akashihi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a frontend expert, so it would be nice if someone experienced will review that too

@rafal-ramocki
Copy link
Copy Markdown

Im interested in this commit. It solves one problem for me. How can I help to make it in main code base?

@DennisOSRM
Copy link
Copy Markdown
Contributor

Im interested in this commit. It solves one problem for me. How can I help to make it in main code base?

The shortest path (pun intended!) to getting this merged is a rebase onto latest main branch. 😉

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Docker-focused configurability for the Nominatim geocoding endpoint, allowing deployments to point the frontend’s address lookup at a custom Nominatim instance (addressing the “where is NOMINATIM config?” requests).

Changes:

  • Introduces a nominatim.url option in src/leaflet_options.js and wires it into leaflet-control-geocoder initialization.
  • Adds NOMINATIM_URL env var support to the build-time replacement script and Docker image defaults.
  • Documents the new Docker environment variable in the README.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/leaflet_options.js Adds a configurable Nominatim URL to frontend options.
src/index.js Passes configured Nominatim URL into Geocoder.nominatim(...).
scripts/replace.js Supports NOMINATIM_URL env var for build-time config injection.
README.md Documents NOMINATIM_URL usage for Docker runs.
docker/Dockerfile Sets default NOMINATIM_URL in the Docker image.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can change the backend by using `-e OSRM_BACKEND='http://localhost:5001'` in the `docker run` command.

Per default address requests are made against the Nominatim demo at `https://nominatim.openstreetmap.org`.
You can change the Nominmatim instance by using `-e NOMINATIM_URL='http://localhost:8080'` in the `docker run` command.
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in documentation: “Nominmatim” should be “Nominatim” (environment variable description).

Suggested change
You can change the Nominmatim instance by using `-e NOMINATIM_URL='http://localhost:8080'` in the `docker run` command.
You can change the Nominatim instance by using `-e NOMINATIM_URL='http://localhost:8080'` in the `docker run` command.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +26
const NOMINATIM = process.env.NOMINATIM_URL || 'https://nominatim.openstreetmap.org'
const DEFAULT_LAYER = process.env.OSRM_DEFAULT_LAYER || 'streets'

// Edit Leaflet Options
if (NOMINATIM) options = options.replace(/\/\/nominatim\.openstreetmap\.org/, NOMINATIM)
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOMINATIM_URL values that already include a trailing slash will produce a double-slash in leaflet_options.js (because the template keeps its existing /). Consider normalizing NOMINATIM (trim trailing slashes) or adjusting the regex to replace the full default URL including the optional trailing / and then append exactly one /.

Copilot uses AI. Check for mistakes.
Comment on lines 96 to 98
var plan = new ReversablePlan([], {
geocoder: Geocoder.nominatim(),
geocoder: Geocoder.nominatim({serviceUrl:leafletOptions.nominatim.url}),
routeWhileDragging: true,
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index.html loads the committed bundle.js, but bundle.js in the repo still uses the old r.nominatim() call and doesn’t include leafletOptions.nominatim. This change won’t take effect for the static build unless npm run build is run and the regenerated bundle.js is committed (or the build/publish pipeline is updated to generate it).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Where is NOMINATIM conf ?

7 participants