Skip to content

Commit 8a46ddb

Browse files
save
1 parent 43a7f90 commit 8a46ddb

File tree

2 files changed

+30
-27
lines changed

2 files changed

+30
-27
lines changed

docker/Dockerfile

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ ARG DOCKER_TAG
33
ARG BUILD_CONCURRENCY
44
RUN mkdir -p /src && mkdir -p /opt
55

6+
67
RUN apt-get update && \
7-
apt-get -y --no-install-recommends install ca-certificates cmake make git gcc g++ libbz2-dev libxml2-dev wget \
8+
apt-get -y --no-install-recommends install ca-certificates curl cmake make git gcc g++ libbz2-dev libxml2-dev wget \
89
libzip-dev libboost1.74-all-dev lua5.4 liblua5.4-dev -o APT::Install-Suggests=0 -o APT::Install-Recommends=0
10+
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && \
11+
apt-get install -y nodejs
912

1013
RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
1114
ldconfig /usr/local/lib && \
@@ -32,36 +35,33 @@ RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
3235
case ${DOCKER_TAG} in *"-debug"*) BUILD_TYPE="Debug";; esac && \
3336
case ${DOCKER_TAG} in *"-assertions"*) BUILD_TYPE="RelWithDebInfo" && ENABLE_ASSERTIONS="On" && BUILD_TOOLS="On";; esac && \
3437
echo "Building ${BUILD_TYPE} with ENABLE_ASSERTIONS=${ENABLE_ASSERTIONS} BUILD_TOOLS=${BUILD_TOOLS}" && \
35-
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS} -DBUILD_TOOLS=${BUILD_TOOLS} -DENABLE_LTO=On && \
38+
cmake .. -DENABLE_NODE_BINDINGS=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS} -DBUILD_TOOLS=${BUILD_TOOLS} -DENABLE_LTO=On && \
3639
make -j${NPROC} install && \
37-
cd ../profiles && \
38-
cp -r * /opt && \
39-
strip /usr/local/bin/* && \
40-
rm -rf /src /usr/local/lib/libosrm*
41-
40+
cd .. && \z
41+
npm install -g --only=production
4242

43-
# Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
44-
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
45-
FROM debian:bullseye-slim as runstage
43+
# # Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
44+
# # Only the content below ends up in the image, this helps remove /src from the image (which is large)
45+
# FROM debian:bullseye-slim as runstage
4646

47-
COPY --from=builder /usr/local /usr/local
48-
COPY --from=builder /opt /opt
47+
# COPY --from=builder /usr/local /usr/local
48+
# COPY --from=builder /opt /opt
4949

50-
RUN apt-get update && \
51-
apt-get install -y --no-install-recommends libboost-program-options1.74.0 libboost-regex1.74.0 \
52-
libboost-date-time1.74.0 libboost-chrono1.74.0 libboost-filesystem1.74.0 \
53-
libboost-iostreams1.74.0 libboost-system1.74.0 libboost-thread1.74.0 \
54-
expat liblua5.4-0 && \
55-
rm -rf /var/lib/apt/lists/* && \
56-
# add /usr/local/lib to ldconfig to allow loading libraries from there
57-
ldconfig /usr/local/lib
50+
# RUN apt-get update && \
51+
# apt-get install -y --no-install-recommends libboost-program-options1.74.0 libboost-regex1.74.0 \
52+
# libboost-date-time1.74.0 libboost-chrono1.74.0 libboost-filesystem1.74.0 \
53+
# libboost-iostreams1.74.0 libboost-system1.74.0 libboost-thread1.74.0 \
54+
# expat liblua5.4-0 && \
55+
# rm -rf /var/lib/apt/lists/* && \
56+
# # add /usr/local/lib to ldconfig to allow loading libraries from there
57+
# ldconfig /usr/local/lib
5858

59-
RUN /usr/local/bin/osrm-extract --help && \
60-
/usr/local/bin/osrm-routed --help && \
61-
/usr/local/bin/osrm-contract --help && \
62-
/usr/local/bin/osrm-partition --help && \
63-
/usr/local/bin/osrm-customize --help
59+
# RUN /usr/local/bin/osrm-extract --help && \
60+
# /usr/local/bin/osrm-routed --help && \
61+
# /usr/local/bin/osrm-contract --help && \
62+
# /usr/local/bin/osrm-partition --help && \
63+
# /usr/local/bin/osrm-customize --help
6464

65-
WORKDIR /opt
65+
# WORKDIR /opt
6666

67-
EXPOSE 5000
67+
# EXPOSE 5000

src/nodejs/node_osrm.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ inline void async(const Nan::FunctionCallbackInfo<v8::Value> &info,
225225
Nan::Set(error_obj,
226226
Nan::New("message").ToLocalChecked(),
227227
Nan::New(error->message).ToLocalChecked());
228+
Nan::Set(error_obj,
229+
Nan::New("description").ToLocalChecked(),
230+
Nan::New(error->message).ToLocalChecked());
228231
Nan::Set(error_obj,
229232
Nan::New("code").ToLocalChecked(),
230233
Nan::New(error->code).ToLocalChecked());

0 commit comments

Comments
 (0)