-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (27 loc) · 1.25 KB
/
Dockerfile
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
ARG BASE_IMAGE=bikenow.vkw.tu-dresden.de/priobike/priobike-graphhopper-drn:stable
# Where the OSM file is located in the base image.
ARG OSM_FILE_PATH=/graphhopper/map.osm
# Depending on the format of the OSM file, we need conversion to have it in the .bz2 format
# This command looks a bit strange, but when downloading the osm file it is saved as planet.osm.bz2,
# although it might not be in .bz2 format.
ARG OVERPASS_PLANET_PREPROCESS='mv /db/planet.osm.bz2 /db/planet.osm && osmium cat -o /db/planet.osm.bz2 /db/planet.osm && rm /db/planet.osm'
# Use this argument to invalidate the cache of subsequent steps.
ARG CACHE_DATE=1970-01-01
FROM $BASE_IMAGE as graphhopper
FROM wiktorn/overpass-api as runner
ARG OSM_FILE_PATH
ARG OVERPASS_PLANET_PREPROCESS
ARG CACHE_DATE
COPY --from=graphhopper $OSM_FILE_PATH /map.osm
ENV OVERPASS_META=no
ENV OVERPASS_MODE=init
ENV OVERPASS_PLANET_URL=file:///map.osm
ENV OVERPASS_PLANET_PREPROCESS=$OVERPASS_PLANET_PREPROCESS
ENV OVERPASS_USE_AREAS=false
ENV OVERPASS_STOP_AFTER_INIT=true
ENV OVERPASS_MAX_TIMEOUT=5
ENV OVERPASS_ALLOW_DUPLICATE_QUERIES=yes
# Imports the OSM file to the database and performs the preprocessing incl. indexing
RUN /app/docker-entrypoint.sh
ENV OVERPASS_STOP_AFTER_INIT=false
CMD ["/app/docker-entrypoint.sh"]