-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
75 lines (62 loc) · 2.21 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
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
FROM debian:stretch
LABEL maintainer="Mapotempo <[email protected]>"
ARG OSRM_VERSION
ENV OSRM_VERSION ${OSRM_VERSION:-v5.18.0}
ARG OSRM_REPOSITORY
ENV OSRM_REPOSITORY ${OSRM_REPOSITORY:-https://github.com/Project-OSRM/osrm-backend.git}
#ENV OSRM_REPOSITORY ${OSRM_REPOSITORY:-https://github.com/Mapotempo/osrm-backend.git}
# OSRM part
###########
# Install needed packages
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential git cmake \
libboost-all-dev libbz2-dev liblua5.2-dev libxml2-dev \
libstxxl-dev libosmpbf-dev libprotobuf-dev libtbb-dev ca-certificates && \
\
# Clone OSRM Backend
git clone ${OSRM_REPOSITORY} --branch ${OSRM_VERSION} && \
\
# Build and install
mkdir -p osrm-backend/build && cd osrm-backend/build && \
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_STXXL=On -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make install && \
# Install needed LUA libraries
mkdir -p /usr/share/lua/5.2 && \
cp -r ../profiles/lib /usr/share/lua/5.2 && \
\
# Copy OSRM profiles and data
mkdir -p /usr/share/osrm/profiles && \
cp ../profiles/*.lua /usr/share/osrm/profiles && \
mkdir -p /usr/share/osrm/data && \
cp ../data/*.geojson /usr/share/osrm/data && \
\
# Cleanup build directory
cd / && rm -rf osrm-backend &&\
\
# Cleanup Debian packages
apt-get remove -y git build-essential && \
apt-get autoremove -y && \
apt-get clean && \
echo -n > /var/lib/apt/extended_states && \
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
VOLUME /srv/osrm/data
# Builder part
##############
# Install needed packages
RUN apt-get update && \
apt-get install -y --no-install-recommends lua-sql-postgres lua-redis osmosis osmium-tool wget curl && \
\
# Cleanup Debian packages
apt-get clean && \
echo -n > /var/lib/apt/extended_states && \
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
# Copy stxxl configuration file.
COPY stxxl .stxxl
COPY entrypoint.sh /usr/bin/entrypoint.sh
COPY osm-manage.sh /usr/bin/osm-manage.sh
VOLUME /srv/osrm/profiles
VOLUME /srv/osm
ENV REGION ""
ENV PROFILE ""
ENV NAME ""
ENV ADDITIONAL_PARAMS ""
CMD /usr/bin/entrypoint.sh -p ${PROFILE} -r ${REGION} -n ${NAME} ${ADDITIONAL_PARAMS}