dockerfiles for pelias services
docker: min version xxx
docker-compose: min version xxx
the following command will build all the images and containers required:
note: this command can take 15-20 minutes depending on your network and hardware.
./build.sh
once the process is complete you can list the running services:
$ docker-compose ps
Name Command State Ports
------------------------------------------------------------------------------------------
pelias_api npm start Up 0.0.0.0:4000->4000/tcp
pelias_baseimage /bin/bash Exit 0
pelias_elasticsearch /bin/bash bin/es-docker Up 0.0.0.0:9200->9200/tcp, 9300/tcp
pelias_geonames /bin/bash Exit 0
pelias_openaddresses /bin/bash Exit 0
pelias_openstreetmap /bin/bash Exit 0
pelias_placeholder npm start Up 0.0.0.0:4100->4100/tcp
pelias_polylines /bin/bash Exit 0
pelias_schema /bin/bash Exit 0
pelias_whosonfirst /bin/bash Exit 0
each of the containers will be able to access this directory internally as /data
, source data downloaded by the containers will be stored here.
note: the data can be fairly large, make sure you have at minimum ~15GB free space available on this volume
mkdir -p /tmp/data
if you wish to change the location of your data directory you can replace all instances of the path in your docker-compose.yml
.
each importer and service has a range of different options, detailed installation and configuration instructions can be found here: https://github.com/pelias/pelias/blob/master/INSTALL.md
for an up-to-date references of supported options you can also view the README files contained in each repository on Github.
the following command will install the pelias schema in elasticsearch:
docker-compose run --rm schema bash -c 'node scripts/create_index.js'
you can confirm this worked correctly by visiting http://localhost:9200/pelias/_mapping
the api service should already be running on port 4000.
you can confirm this worked correctly by visiting http://localhost:4000/v1/search?text=example
note: this guide only covers importing the admin areas (like cities, countries etc.)
ensure the data directory exists:
mkdir -p /tmp/data/whosonfirst
download the data:
docker-compose run --rm whosonfirst bash -c 'node download_data.js'
import whosonfirst data:
docker-compose run --rm whosonfirst bash -c 'npm start'
ensure the data directory exists:
mkdir -p /tmp/data/openstreetmap
download the data:
wget -qO- https://s3.amazonaws.com/metro-extracts.mapzen.com/singapore.osm.pbf > /tmp/data/openstreetmap/extract.osm.pbf
import openstreetmap data:
docker-compose run --rm openstreetmap bash -c 'npm start'
you can restrict the downloader to a single country by adding a countryCode
property in your pelias.json
:
"imports": {
"geonames": {
...
"countryCode": "SG"
}
}
ensure the data directory exists:
mkdir -p /tmp/data/geonames
download the data:
docker-compose run --rm geonames bash -c 'npm run download'
import geonames data:
docker-compose run --rm geonames bash -c 'npm start'