-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
337 lines (319 loc) · 10.2 KB
/
docker-compose.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
############################################################
#
# A World Map from OSM published as vector tiles in
# gospatial/tegola
#
# Data (c) OpenStreetMap Contributors
# This Project (c) Tim Sutton, 2022
############################################################
version: "3.9"
#
# DOCKER IMAGES
#
# 13-3.1 is the first pg version with FORCE_SSL support
# needed to force clients to use SSL
x-postgres-image: &postgres-image kartoza/postgis:13-3.1
x-osm-update-image: &osm-update-image kartoza/docker-osm:osmupdate-latest
x-imposm-image: &imposm-image kartoza/docker-osm:imposm-latest
x-osmenrich-image: &osm-enrich-image kartoza/docker-osm:osmenrich-latest
x-tegola-image: &tegola-image gospatial/tegola
x-maputnik-editor-image: &maputnik-editor-image maputnik/editor
x-planet-downloader-image: &planet-downloader-image openmaptiles/openmaptiles-tools
#
# VOLUMES
#
# Generally we are using docker volumes for all volumes
# except conf files which are host mounted volumes out
# of our git repo checkout.
#
volumes:
import_done:
import_queue:
osm_import_done:
osm_import_queue:
# postgis_data:
#
# SERVICES
#
services:
db:
image: *postgres-image
# Allocate more then the default 64mb to postgresql
shm_size: 10g
volumes:
# Persistent storage of the database cluster
# :z needed on systems like fedora using selinux
# when using host mounted volumes
- ./postgis_data:/var/lib/postgresql:z
env_file: .env
environment:
# You can define multiple databases by providing a comma
# separated list here.
# gis - for general purpose gis projects
# mergin-server - for mergin server flask app
# mergin - for mergin-db-sync
- POSTGRES_DB=gis
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASS=${POSTGRES_PASSWORD}
# Read the notes at
# https://github.com/kartoza/docker-postgis#postgres-ssl-setup
# Certificate from letsencrypt doesn't currently work
#- SSL_CERT_FILE=/etc/letsencrypt/live/${DOMAIN}/cert.pems
#- SSL_KEY_FILE=/etc/letsencrypt/live/${DOMAIN}/privkey.pem
#- SSL_CA_FILE=/your/own/ssl_ca_file.pem
# Force clients to connect with SSL - will add hostssl
# instead of host to lines in pg_hba.conf
- FORCE_SSL=TRUE
# When connecting using your client, set SSL mode to 'Require'
# If you want force using a certificate, use PASSWORD_AUTHENTICATION=cert
# But then you also need to deploy certificates (again see the docs above)
- ALLOW_IP_RANGE=0.0.0.0/0
- PASSWORD_AUTHENTICATION=scram-sha-256
# You can pass as many extensions as you need.
- POSTGRES_MULTIPLE_EXTENSIONS=postgis,hstore,postgis_topology,postgis_raster,pgrouting
# Some extensions need to be registered in the postgresql.conf as
# shared_preload_libraries. pg_cron should always be added because the
# extension is installed with the image.
- SHARED_PRELOAD_LIBRARIES=pg_cron
- DEFAULT_ENCODING="UTF8"
- DEFAULT_COLLATION="en_US.UTF-8"
- DEFAULT_CTYPE="en_US.UTF-8"
- POSTGRES_TEMPLATE_EXTENSIONS=true
networks:
- osmmirror
ports:
- ${POSTGRES_PUBLIC_PORT}:${POSTGRES_PRIVATE_PORT}
restart: unless-stopped
healthcheck:
test: "exit 0"
logging:
driver: json-file
options:
max-size: 200m
max-file: '10'
############################################################
#
# OSM Sync Services
#
############################################################
imposm:
image: *imposm-image
volumes:
# These are sharable to other containers
# :z needed on systems like fedora using selinux
# when using host mounted volumes
- ./conf/osm_conf:/home/settings:z
- osm_import_done:/home/import_done:z
- osm_import_queue:/home/import_queue:z
#- osm_cache:/home/cache
- ./osm_cache:/home/cache:z
depends_on:
- db
networks:
- osmmirror
env_file: .env
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASS=${POSTGRES_PASSWORD}
- POSTGRES_DBNAME=gis
- POSTGRES_PORT=${POSTGRES_PRIVATE_PORT}
- POSTGRES_HOST=db
- SSL_MODE=require
# seconds between 2 executions of the script if 0, then no
# update will be done, only the first initial import from the
# PBF
- TIME=120
# folder for settings (with *.json and *.sql)
- SETTINGS=settings
# folder for caching
- CACHE=cache
# folder for diff which has been imported
- IMPORT_DONE=import_done
# folder for diff which hasn't been imported yet
- IMPORT_QUEUE=import_queue
# it can be 3857
- SRID=4326
# see http://imposm.org/docs/imposm3/latest/tutorial.html#optimize
- OPTIMIZE=false
# see http://imposm.org/docs/imposm3/latest/tutorial.html#deploy-production-tables
- DBSCHEMA_PRODUCTION=${DBSCHEMA_PRODUCTION}
# http://imposm.org/docs/imposm3/latest/tutorial.html#deploy-production-tables
- DBSCHEMA_IMPORT=osm_import
# http://imposm.org/docs/imposm3/latest/tutorial.html#deploy-production-tables
- DBSCHEMA_BACKUP=osm_backup
# Install some styles if you are using the default mapping.
# It can be 'yes' or 'no'
- QGIS_STYLE=no
# Use clip in the database
- CLIP=no
restart: unless-stopped
logging:
driver: json-file
options:
max-size: 200m
max-file: '10'
osmupdate:
image: *osm-update-image
volumes:
# These are sharable to other containers
# :z needed on systems like fedora using selinux
# when using host mounted volumes
- ./conf/osm_conf:/home/settings:z
- osm_import_done:/home/import_done:z
- osm_import_queue:/home/import_queue:z
#- osm_cache:/home/cache
- ./osm_cache:/home/cache:z
depends_on:
- db
networks:
- osmmirror
environment:
# These are all currently the defaults but listed here for
# your convenience if you want to change them.
# The maximum time range to assemble a cumulated changefile.
- MAX_DAYS=100
# osmupdate uses a combination of minutely, hourly and daily
# changefiles. This value can be minute, hour, day or
# sporadic.
- DIFF=sporadic
# argument to determine the maximum number of parallely
# processed changefiles.
- MAX_MERGE=7
# define level for gzip compression. values between 1 (low
# compression but fast) and 9 (high compression but slow)
- COMPRESSION_LEVEL=1
# change the URL to use a custom URL to fetch regional file
# updates.
- BASE_URL=http://planet.openstreetmap.org/replication/
# folder for diff which hasn't been imported yet
- IMPORT_QUEUE=import_queue
# folder for diff which has been imported
- IMPORT_DONE=import_done
# seconds between 2 executions of the script
# if 0, then no update will be done, only the first initial
# import from the PBF
- TIME=120
restart: unless-stopped
logging:
driver: json-file
options:
max-size: 200m
max-file: '10'
tegola:
image: *tegola-image
entrypoint: /opt/tegola
command: serve --config /config/tegola.conf
volumes:
# :z needed on systems like fedora using selinux
# when using host mounted volumes
- ./conf/tegola_conf:/config:z
- ./tiles:/tmp/tegola:z
depends_on:
- db
ports:
- 9090:9090
networks:
- osmmirror
env_file: .env
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASS=${POSTGRES_PASSWORD}
- POSTGRES_DBNAME=gis
- POSTGRES_PORT=${POSTGRES_PRIVATE_PORT}
- POSTGRES_HOST=db
- SSL_MODE=require
- TEGOLA_PORT=9090
restart: unless-stopped
logging:
driver: json-file
options:
max-size: 200m
max-file: '10'
tegola-seed:
image: *tegola-image
entrypoint: /opt/tegola
command: cache seed --min-zoom 0 --max-zoom 4 --overwrite --concurrency 16 --config /config/tegola.conf
volumes:
# :z needed on systems like fedora using selinux
# when using host mounted volumes
- ./conf/tegola_conf:/config:z
- ./tiles:/tmp/tegola:z
depends_on:
- db
networks:
- osmmirror
env_file: .env
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASS=${POSTGRES_PASSWORD}
- POSTGRES_DBNAME=gis
- POSTGRES_PORT=${POSTGRES_PRIVATE_PORT}
- POSTGRES_HOST=db
- SSL_MODE=require
- TEGOLA_PORT=9999 # Anything different to the main tegola service
restart: never
logging:
driver: json-file
options:
max-size: 200m
max-file: '10'
tegola-purge:
image: *tegola-image
entrypoint: /opt/tegola
command: cache purge --min-zoom 0 --max-zoom 24 --overwrite --concurrency 16 --config /config/tegola.conf
volumes:
# :z needed on systems like fedora using selinux
# when using host mounted volumes
- ./conf/tegola_conf:/config:z
- ./tiles:/tmp/tegola:z
depends_on:
- db
networks:
- osmmirror
env_file: .env
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASS=${POSTGRES_PASSWORD}
- POSTGRES_DBNAME=gis
- POSTGRES_PORT=${POSTGRES_PRIVATE_PORT}
- POSTGRES_HOST=db
- SSL_MODE=require
- TEGOLA_PORT=9999 # Anything different to the main tegola service
restart: never
logging:
driver: json-file
options:
max-size: 200m
max-file: '10'
maputnik-editor:
image: *maputnik-editor-image
depends_on:
- tegola
ports:
- 8888:8888
networks:
- osmmirror
restart: unless-stopped
logging:
driver: json-file
options:
max-size: 200m
max-file: '10'
planet-downloader:
image: *planet-downloader-image
entrypoint: download-osm planet
command: -- -d /download
volumes:
# :z needed on systems like fedora using selinux
# when using host mounted volumes
- ./conf/osm_conf:/downloads:z
networks:
- osmmirror
restart: never
logging:
driver: json-file
options:
max-size: 200m
max-file: '10'
networks:
osmmirror: