Public | Automated Build

Last pushed: 2 months ago
Short Description
Overpass API ( image based on NGINX. User Overpass to query for OSM data
Full Description

How to use this image

This image on startup initializes with data on first start.
To do it properly it needs a bit of guidance in form of enviroment variables.

  • OVERPASS_MODE - takes the value of either init or clone
  • OVERPASS_META - yes, no or attic - passed to Overpass as --meta or --keep-attic
  • OVERPASS_DIFF_URL - url to diff's directory for updating the instance (eg.
  • OVERPASS_PLANET_URL - url to "planet" file in init mode
  • OVERPASS_PLANET_SEQUENCE_ID - sequence identifier corresponding to planet file above. All files after this one will be applied
  • OVERPASS_COMPRESSION - takes values of no, gz or lz4. Specifies compression mode of the Overpass database.
    Ony useful in init mode. Defaults to gz
  • OVERPASS_RULES_LOAD - desired load generated by areas generation. Controls how long the script will sleep before regenerating
    areas. Set it to 1, and script will sleep 99x times longer than it works, set it to 50 - and script will sleep as long as last
    execution, set it to 100, and script will sleep 3 seconds between each execution. Defaults to 1.

Image works in two modes clone or init. This affects how the instance gets initialized. If the mode is set to clone
then data is copied from and then updated from diffs. This will result in Overpass instance
covering whole world. This mode works only with minute diffs.

In init mode you need to point OVERPASS_PLANET_URL to address with planet (partial) dump. This file will be downloaded,
indexed by Overpass and later - updated using OVERPASS_PLANET_SEQUENCE_ID and OVERPASS_DIFF_URL. You need to check which
sequence number is for your planet file. Take it from desctiption or just take a sequence number a day before your planet
file is dated.

Start initalization mode with -i and -t options to docker run so you will have a chance to monitor the progress of
file downloads etc.

After initialization is finished Docker container will stop. Once you start it again (with docker start command) it will start
downloading minute diffs, applying them to database and serving API requests.

Container exposes port 80.

All data resides within /db directory in container.


Overpass instance covering part of the world

In this example Overpass instance will be initialized with planet file for Monaco downloaded from Geofabrik. Data will be stored in folder
/big/docker/overpass_db/ on the host machine. Overpass will be available on port 12345 on host machine.

docker run \
  -e OVERPASS_META=yes \
  -e OVERPASS_MODE=init \
  -v /big/docker/overpass_db/:/db
  -p 12345:80 \
  -i -t \
  --name overpass_monaco wiktorn/overpass-api

Overpass clone covering whole world

In this example Overpass instance will be initialized with data from main Overpass instance and updated with master planet diffs.
Data will be stored in /big/docker/overpass_clone_db/ directory on the host machine and API will be exposed on port 12346 on host machine.

docker run \
  -e OVERPASS_MODE=clone
  -v /big/docker/overpass_clone_db/:/db
  -p 12346:80
  -i -t
  --name overpass_world
Docker Pull Command
Source Repository