Remove graphhopper.sh (#2)

* Remove graphhopper.sh file

This still needs to be tested...

* Remove graphhopper.sh, fix java arguments

* Update README.md

* Update Dockerfile

* Add more concrete example
هذا الالتزام موجود في:
Harel M
2021-07-12 22:02:10 +03:00
ملتزم من قبل GitHub
الأصل aee63fc944
التزام 40c818460b
2 ملفات معدلة مع 20 إضافات و7 حذوفات

عرض الملف

@@ -6,24 +6,24 @@ WORKDIR /graphhopper
COPY . .
RUN ./graphhopper.sh build
RUN mvn clean install
FROM openjdk:11.0-jre
ENV JAVA_OPTS "-Xmx1g -Xms1g -Ddw.server.application_connectors[0].bind_host=0.0.0.0 -Ddw.server.application_connectors[0].port=8989"
ENV TOOL_OPTS "-Ddw.graphhopper.datareader.file=europe_germany_berlin.pbf -Ddw.graphhopper.graph.location=default-gh"
RUN mkdir -p /data
WORKDIR /graphhopper
COPY --from=build /graphhopper/web/target/*.jar ./web/target/
# pom.xml is used to get the jar file version. see https://github.com/graphhopper/graphhopper/pull/1990#discussion_r409438806
COPY ./graphhopper.sh ./pom.xml ./config-example.yml ./
COPY --from=build /graphhopper/web/target/graphhopper*.jar ./
COPY ./config-example.yml ./
VOLUME [ "/data" ]
EXPOSE 8989
ENTRYPOINT [ "./graphhopper.sh", "web" ]
CMD [ "/data/europe_germany_berlin.pbf" ]
ENTRYPOINT [ "java $JAVA_OPTS $TOOL_OPTS -jar *.jar", "server config-example.yml" ]

عرض الملف

@@ -13,3 +13,16 @@ This repository is extremely simple, all it does is the following:
That's all.
Feel free to submit issues or pull requests if you would like to improve the code here
In order to use this image there are two environment variables you need to pass to docker:
```
JAVA_OPTS: "-Xmx1g -Xms1g -Ddw.server.application_connectors[0].bind_host=0.0.0.0 -Ddw.server.application_connectors[0].port=8989"
TOOL_OPTS: "-Ddw.graphhopper.datareader.file=flie-location-inside-docker.pbf -Ddw.graphhopper.graph.location=default-gh"
```
Without the `TOOL_OPTS` this image won't run!
You can also completely override the entry point and use this for example:
```
docker run --entrypoint /bin/bash israelhikingmap/graphhhopper -c "wget https://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf -O /data/berlin.osm.bpf && java -Ddw.graphhopper.datareader.file=/data/berlin.osm.pbf -Ddw.graphhopper.graph.location=berlin-gh -jar *.jar server config-example.yml"
```