-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
107 lines (94 loc) · 3.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
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
FROM ubuntu:focal as buildstage
ENV BUMP 20200920.1
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
build-essential \
ca-certificates \
cmake \
git \
libasio-dev \
libboost-all-dev \
libbz2-dev \
liblua5.2-dev \
libluabind-dev \
libssl-dev \
libstxxl-dev \
libstxxl1v5 \
libtbb-dev \
libxml2-dev \
libzip-dev \
lua5.2 \
pkg-config
ENV OSRM_BACKEND_VERSION v5.24.0
RUN git clone --branch $OSRM_BACKEND_VERSION --single-branch --depth 1 https://github.com/Project-OSRM/osrm-backend.git
#COPY ./osrm-gcc9.patch /osrm-backend/
RUN cd /osrm-backend && \
# patch -p1 < osrm-gcc9.patch && \
git show --format="%H" | head -n1 > /opt/OSRM_GITSHA && \
echo "Building OSRM gitsha $(cat /opt/OSRM_GITSHA)" && \
mkdir -p build && \
cd build && \
BUILD_TYPE="Release" && \
ENABLE_ASSERTIONS="Off" && \
BUILD_TOOLS="Off" && \
echo "Building ${BUILD_TYPE} with ENABLE_ASSERTIONS=${ENABLE_ASSERTIONS} BUILD_TOOLS=${BUILD_TOOLS}" && \
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS} -DBUILD_TOOLS=${BUILD_TOOLS} -DENABLE_LTO=On && \
cmake build . && \
cmake --build . --target install && \
ldconfig
ENV VROOM_VERSION master
RUN git clone --depth 1 --single-branch --branch $VROOM_VERSION https://github.com/VROOM-Project/vroom.git && \
mkdir vroom/bin && \
cd vroom/src && \
make && \
cp ../bin/* /usr/local/bin && \
ldconfig
FROM ubuntu:focal as runstage
COPY --from=buildstage /usr/local /usr/local
COPY --from=buildstage /opt /opt
RUN mkdir -p /src && \
mkdir -p /opt && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
curl \
expat \
expect \
git \
gosu \
libboost-chrono1.71.0 \
libboost-date-time1.71.0 \
libboost-filesystem1.71.0 \
libboost-iostreams1.71.0 \
libboost-program-options1.71.0 \
libboost-regex1.71.0 \
libboost-thread1.71.0 \
liblua5.2-0 \
libtbb2 \
netcat \
postgresql-client && \
git clone --depth 1 https://github.com/VROOM-Project/vroom-express.git && \
useradd -m -s /bin/bash osm && \
useradd -m -s /bin/bash osrm && \
useradd -m -s /bin/bash vroom && \
mkfifo -m 600 /vroom-express/logpipe && \
touch /vroom-express/access.log && \
touch /vroom-express/error.log && \
chown vroom /vroom-express/logpipe /vroom-express/access.log /vroom-express/error.log && \
sed -ri "s/(osrm_address:).*,/\1 \"osrm-backend\",/" /vroom-express/src/index.js && \
apt purge -y git && \
apt autoremove --purge -y && \
apt clean && \
rm -rf /var/lib/apt/lists/*
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN cd /vroom-express && \
npm install
WORKDIR /vroom-express
COPY vroom-express.sh /usr/local/bin/vroom-express.sh
CMD ["vroom-express.sh"]
EXPOSE 5000
EXPOSE 3000