Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitija-surange authored Mar 31, 2020
1 parent 2a3bde7 commit 2a22a67
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
42 changes: 42 additions & 0 deletions osrm_india_map/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM debian:buster-slim as buildstage
LABEL maintainer="Utsav Mishra <https://festivitymishra.github.io/>"

# Install dependencies
RUN apt-get update && \
apt-get install -y git pkg-config && \
apt-get install wget && \
apt-get -y --no-install-recommends install cmake make git gcc g++ libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev -o APT::Install-Suggests=0 -o APT::Install-Recommends=0

# Build osrm-backend
RUN git clone -b v5.19.0 --depth 1 https://github.com/Project-OSRM/osrm-backend.git && \
cd osrm-backend && \
echo "Building OSRM ${DOCKER_TAG}" && \
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" && \
case ${DOCKER_TAG} in *"-debug"*) BUILD_TYPE="Debug";; esac && \
case ${DOCKER_TAG} in *"-assertions"*) BUILD_TYPE="RelWithDebInfo" && ENABLE_ASSERTIONS="On" && BUILD_TOOLS="On";; esac && \
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 && \
make install && \
cd .. && \
wget -O india.osm.pbf --random-wait http://download.geofabrik.de/asia/india-latest.osm.pbf && \
osrm-extract india.osm.pbf -p profiles/car.lua && \
osrm-partition india.osrm && \
osrm-customize india.osrm && \
rm -r india.osm.pbf && \
cd build && \
cd ../profiles && \
cp -r * /opt && \
ldconfig && \
cd ..

WORKDIR /osrm-backend

CMD osrm-routed --max-matching-size 50000 --max-table-size 50000 --max-viaroute-size 50000 --algorithm=MLD india.osrm

23 changes: 23 additions & 0 deletions osrm_india_map/instructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

## Create a dir for building an images

mkdir osrm_india_map
cd osrm_india_map

##copy Dockerfile here or create a new file and paste the content in it.

nano Dockerfile

## Lets make the image

docker build -t osrm_india_map .

## Lets run the container

docker run -p 5000:5000 osrm_india_map

## Test if it is working

curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"


0 comments on commit 2a22a67

Please sign in to comment.