-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-pelias.yml
175 lines (160 loc) · 6.95 KB
/
build-pelias.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
version: '3.9'
name: build-pelias
services:
#
# DATA IMPORTERS
#
# https://github.com/pelias/openstreetmap
#
# The main OSM importer, pelias/openstreetmap, handles venues and addresses.
# https://github.com/pelias/documentation/blob/master/data-sources.md#openstreetmap
openstreetmap:
image: ${IMAGE_PELIAS_OPENSTREETMAP:?}
volumes:
- "${PELIAS_BUILD_DIR:?}/pelias.json:/code/pelias.json"
- "${PELIAS_BUILD_DIR:?}/data:/data"
# https://github.com/pelias/polylines
#
# The pelias/polylines OSM importer handles streets, since dealing with line geometry is a special challenge.
# https://github.com/pelias/documentation/blob/master/data-sources.md#openstreetmap
polylines:
image: ${IMAGE_PELIAS_POLYLINES:?}
volumes:
- "${PELIAS_BUILD_DIR:?}/pelias.json:/code/pelias.json"
- "${PELIAS_BUILD_DIR:?}/data:/data"
# Supports importing admin areas and venues from Who's On First
# https://github.com/pelias/pelias/#data-importers
whosonfirst:
image: ${IMAGE_PELIAS_WHOSONFIRST:?}
volumes:
- "${PELIAS_BUILD_DIR:?}/pelias.json:/code/pelias.json"
- "${PELIAS_BUILD_DIR:?}/data:/data"
gtfs:
build:
context: ${PELIAS_BUILD_DIR:?}/gtfs
args:
- IMAGE_PELIAS_BASE=${IMAGE_PELIAS_BASE:?}
- DOCKERFILE_PELIAS_GTFS=${DOCKERFILE_PELIAS_GTFS:?}
volumes:
- "${PELIAS_BUILD_DIR:?}/pelias.json:/code/pelias.json"
- "${PELIAS_BUILD_DIR:?}/data:/data"
polylines-gen:
build:
context: ${PELIAS_BUILD_DIR:?}/polylines-gen
args:
- IMAGE_GO=${IMAGE_GO:?}
volumes:
- "${PELIAS_BUILD_DIR:?}/data:/data"
#
# SETUP
#
# https://github.com/pelias/schema/
#
# pelias-schema sets up Elasticsearch indices properly for Pelias
# https://github.com/pelias/pelias/#database
schema:
image: ${IMAGE_PELIAS_SCHEMA:?}
volumes:
- "${PELIAS_BUILD_DIR:?}/pelias.json:/code/pelias.json"
#
# SERVICES
#
# https://github.com/pelias/api
#
# This is the core of Pelias. It talks to all other services (if available), Elasticsearch, and provides the interface for all queries to Pelias.
# https://github.com/pelias/documentation/blob/master/services.md#descriptions
api:
image: ${IMAGE_PELIAS_API:?}
restart: unless-stopped
environment: [ "PORT=4000" ]
ports: [ "127.0.0.1:4000:4000" ]
volumes:
- "${PELIAS_BUILD_DIR:?}/pelias.json:/code/pelias.json"
depends_on:
elasticsearch:
condition: service_healthy
# https://github.com/pelias/libpostal-service
#
# Libpostal is a library that provides an address parser using a statistical natural language processing model trained on OpenStreetMap, OpenAddresses, and other open data. It is quite good at parsing fully specified input, but cannot handle autocomplete very well.
# https://github.com/pelias/documentation/blob/master/services.md#descriptions
#
# GIF demonstration on parsing a full address input: https://github.com/openvenues/libpostal#examples-of-parsing
libpostal:
image: ${IMAGE_PELIAS_LIBPOSTAL:?}
restart: unless-stopped
ports: [ "127.0.0.1:4400:4400" ]
# https://github.com/pelias/placeholder
#
# Placeholder is used specifically to handle the relational component of geocoding. Placeholder understands, for example, that Paris is a city in a country called France, but that there is another city called Paris in the state of Texas, USA.
# Placeholder also stores the translations of administrative areas in multiple languages. Therefore, it is required if any support for multiple languages is desired.
# https://github.com/pelias/documentation/blob/master/services.md#descriptions
#
# Configuration: `PLACEHOLDER_DATA` - Path to the directory where the placeholder service will find the `store.sqlite3` database file.
# https://github.com/pelias/placeholder#configuration-via-environment-variables
placeholder:
image: ${IMAGE_PELIAS_PLACEHOLDER:?}
restart: unless-stopped
environment: [ "PORT=4100" ]
ports: [ "127.0.0.1:4100:4100" ]
volumes:
- "${PELIAS_BUILD_DIR:?}/pelias.json:/code/pelias.json"
- "${PELIAS_BUILD_DIR:?}/data:/data"
# https://github.com/pelias/interpolation
#
# The interpolation service combines street geometries with known addresses and address ranges, to allow estimating the position of addresses that might exist, but aren't in existing open data sources.
# https://github.com/pelias/documentation/blob/master/services.md#descriptions
#
# CMD [ "./interpolate", "server", "/data/interpolation/address.db", "/data/interpolation/street.db" ]
# https://github.com/pelias/interpolation/blob/a1451e9ba4db4ceabd53018310ab700cbc39708f/Dockerfile#L62
#
# The data is split into 2 different sqlite3 databases: street.db and address.db
# https://github.com/pelias/interpolation#architecture
interpolation:
image: ${IMAGE_PELIAS_INTERPOLATION:?}
restart: unless-stopped
environment: [ "PORT=4300" ]
ports: [ "127.0.0.1:4300:4300" ]
volumes:
- "${PELIAS_BUILD_DIR:?}/pelias.json:/code/pelias.json"
- "${PELIAS_BUILD_DIR:?}/data:/data"
# https://github.com/pelias/pip-service
#
# The Point-in-Polygon (PIP) service loads polygon data representing the boundaries of cities, states, regions, countries etc. into memory, and can perform calculations on that geometric data. It's used to determine if a given point lies in a particular polygon. Thus, it's highly recommended for reverse geocoding.
# https://github.com/pelias/documentation/blob/master/services.md#descriptions
#
# It will look for Who's On First data in the place configured in `pelias.json`.
# https://github.com/pelias/pip-service#usage
pip:
image: ${IMAGE_PELIAS_PIP:?}
restart: unless-stopped
environment: [ "PORT=4200" ]
ports: [ "127.0.0.1:4200:4200" ]
volumes:
- "${PELIAS_BUILD_DIR:?}/pelias.json:/code/pelias.json"
- "${PELIAS_BUILD_DIR:?}/data:/data"
# The underlying datastore that does most of the query heavy-lifting and powers our search results. We use Elasticsearch. Currently, versions 6 and 7 are supported.
# https://github.com/pelias/pelias/#database
elasticsearch:
image: ${IMAGE_PELIAS_ELASTICSEARCH:?}
restart: unless-stopped
ports: [ "127.0.0.1:9200:9200", "127.0.0.1:9300:9300" ]
volumes:
- "${PELIAS_BUILD_DIR:?}/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro"
- "${PELIAS_BUILD_DIR:?}/data/elasticsearch:/usr/share/elasticsearch/data"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add: [ "IPC_LOCK" ]
security_opt:
- seccomp=unconfined
healthcheck:
# https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html#cluster-health-api-desc
test: curl -sSf 'http://localhost:9200/_cluster/health?wait_for_status=green&timeout=1s' | grep --fixed-strings '"timed_out":false' || exit 1
interval: 30s
retries: 5
start_period: 20s
timeout: 5s