Commit ·
84edfcf
1
Parent(s): 0d32813
fix: Use OSRM backend as runtime base image to fix missing shared libraries (exit code 127)
Browse files- Dockerfile +3 -23
Dockerfile
CHANGED
|
@@ -6,46 +6,26 @@ RUN npm ci --include=dev
|
|
| 6 |
COPY backend/ ./
|
| 7 |
RUN npm run build && ls -la dist/
|
| 8 |
|
| 9 |
-
FROM
|
| 10 |
|
| 11 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 12 |
ENV TZ=UTC
|
| 13 |
|
| 14 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 15 |
-
curl wget ca-certificates gnupg lsb-release \
|
| 16 |
-
supervisor \
|
| 17 |
-
# OSRM dependencies
|
| 18 |
-
libboost-filesystem1.74.0 \
|
| 19 |
-
libboost-regex1.74.0 \
|
| 20 |
-
libboost-iostreams1.74.0 \
|
| 21 |
-
libboost-thread1.74.0 \
|
| 22 |
-
libboost-date-time1.74.0 \
|
| 23 |
-
libtbb12 \
|
| 24 |
-
libluajit-5.1-2 \
|
| 25 |
-
liblua5.2-0 \
|
| 26 |
-
expat \
|
| 27 |
-
# needed for map download
|
| 28 |
-
wget \
|
| 29 |
&& rm -rf /var/lib/apt/lists/*
|
| 30 |
|
| 31 |
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
| 32 |
&& apt-get install -y nodejs \
|
| 33 |
&& rm -rf /var/lib/apt/lists/*
|
| 34 |
|
| 35 |
-
COPY --from=osrm/osrm-backend:latest /usr/local/bin/osrm-extract /usr/local/bin/
|
| 36 |
-
COPY --from=osrm/osrm-backend:latest /usr/local/bin/osrm-partition /usr/local/bin/
|
| 37 |
-
COPY --from=osrm/osrm-backend:latest /usr/local/bin/osrm-customize /usr/local/bin/
|
| 38 |
-
COPY --from=osrm/osrm-backend:latest /usr/local/bin/osrm-routed /usr/local/bin/
|
| 39 |
-
COPY --from=osrm/osrm-backend:latest /usr/local/lib/ /usr/local/lib/
|
| 40 |
-
RUN ldconfig
|
| 41 |
-
|
| 42 |
RUN useradd -m -u 1000 user
|
| 43 |
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
|
| 44 |
|
| 45 |
RUN mkdir -p /data && chmod 777 /data
|
| 46 |
RUN wget -q "https://download.geofabrik.de/europe/luxembourg-latest.osm.pbf" \
|
| 47 |
-O /data/map.osm.pbf \
|
| 48 |
-
&& osrm-extract -p /
|
| 49 |
&& osrm-partition /data/map.osrm \
|
| 50 |
&& osrm-customize /data/map.osrm \
|
| 51 |
&& rm /data/map.osm.pbf \
|
|
|
|
| 6 |
COPY backend/ ./
|
| 7 |
RUN npm run build && ls -la dist/
|
| 8 |
|
| 9 |
+
FROM osrm/osrm-backend:latest AS runtime
|
| 10 |
|
| 11 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 12 |
ENV TZ=UTC
|
| 13 |
|
| 14 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 15 |
+
curl wget ca-certificates gnupg lsb-release supervisor \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
| 19 |
&& apt-get install -y nodejs \
|
| 20 |
&& rm -rf /var/lib/apt/lists/*
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
RUN useradd -m -u 1000 user
|
| 23 |
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
|
| 24 |
|
| 25 |
RUN mkdir -p /data && chmod 777 /data
|
| 26 |
RUN wget -q "https://download.geofabrik.de/europe/luxembourg-latest.osm.pbf" \
|
| 27 |
-O /data/map.osm.pbf \
|
| 28 |
+
&& osrm-extract -p /opt/car.lua /data/map.osm.pbf \
|
| 29 |
&& osrm-partition /data/map.osrm \
|
| 30 |
&& osrm-customize /data/map.osrm \
|
| 31 |
&& rm /data/map.osm.pbf \
|