From ac0d3ae518a73d5776facfb21d63d2f56fe0ba93 Mon Sep 17 00:00:00 2001 From: Joachim Lengacher Date: Tue, 21 Nov 2023 12:26:15 +0100 Subject: [PATCH 1/3] new Dockerfile --- Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f72e6982 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM gradle:jdk17-jammy as build + +RUN mkdir /tmp/brouter +WORKDIR /tmp/brouter +COPY . . +RUN ./gradlew clean build + +FROM openjdk:17.0.1-jdk-slim +COPY --from=build /tmp/brouter/brouter-server/build/libs/brouter-*-all.jar /brouter.jar +COPY --from=build /tmp/brouter/misc/scripts/standalone/server.sh /bin/ + +CMD /bin/server.sh + From 0e6cd542cf23aaa47e6be71fd93900663d4e011b Mon Sep 17 00:00:00 2001 From: Joachim Lengacher Date: Thu, 23 Nov 2023 16:24:13 +0100 Subject: [PATCH 2/3] Added description for Docker usage. --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index b1fcbc2a..92f7c41a 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,21 @@ The API endpoints exposed by this HTTP server are documented in the [`brouter-server/src/main/java/btools/server/request/ServerHandler.java`](brouter-server/src/main/java/btools/server/request/ServerHandler.java) file. +## BRouter with Docker + +To build the Docker image run (in the project's to level directory): + +``` +docker build -t brouter . +``` + +Download the segment files as described in the previous chapter. The folder containing the +segment files and the one containing the profiles can be mounted into the container. Run +BRouter as follows: + +``` +docker run --rm -v ./misc/scripts/segments4:/segments4 -v ./misc/profiles2:/profiles2 brouter +``` ## Documentation From 226f677b265675b9e942155ada0e331d094a5d55 Mon Sep 17 00:00:00 2001 From: Joachim Lengacher Date: Tue, 16 Jan 2024 17:36:35 +0100 Subject: [PATCH 3/3] Provide default profiles including variants. --- Dockerfile | 1 + README.md | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f72e6982..2152dc81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ RUN ./gradlew clean build FROM openjdk:17.0.1-jdk-slim COPY --from=build /tmp/brouter/brouter-server/build/libs/brouter-*-all.jar /brouter.jar COPY --from=build /tmp/brouter/misc/scripts/standalone/server.sh /bin/ +COPY --from=build /tmp/brouter/misc/* /profiles2 CMD /bin/server.sh diff --git a/README.md b/README.md index 92f7c41a..6a223a7a 100644 --- a/README.md +++ b/README.md @@ -139,18 +139,25 @@ file. ## BRouter with Docker -To build the Docker image run (in the project's to level directory): +To build the Docker image run (in the project's top level directory): ``` docker build -t brouter . ``` Download the segment files as described in the previous chapter. The folder containing the -segment files and the one containing the profiles can be mounted into the container. Run -BRouter as follows: +segment files can be mounted into the container. Run BRouter as follows: ``` -docker run --rm -v ./misc/scripts/segments4:/segments4 -v ./misc/profiles2:/profiles2 brouter +docker run --rm -v ./misc/scripts/segments4:/segments4 brouter +``` + +This will start brouter with a set of default routing profiles. + +If you want to provide your own routing profiles, you can also mount the folder containing the custom profiles: + +``` +docker run --rm -v ./misc/scripts/segments4:/segments4 -v /path/to/custom/profiles:/profiles2 brouter ``` ## Documentation