forked from javandres/conveyal-analysis-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_r5
35 lines (26 loc) · 991 Bytes
/
Dockerfile_r5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Build with:
# docker build . --build-arg r5version=$(gradle -q printVersion | head -n1)
# or
# docker build . --build-arg r5version=$(cat build/version.txt)
# We could instead run the Gradle build and/or fetch version information
# using run actions within the Dockerfile
FROM openjdk:11
ARG r5version
ENV R5_VERSION=$r5version
ENV JVM_HEAP_GB=2
WORKDIR /r5
# Add wait tool, to wait for Mongo to be up
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.7.3/wait /wait
RUN chmod +x /wait
RUN wget https://services.gradle.org/distributions/gradle-6.7.1-bin.zip
RUN unzip gradle-6.7.1-bin.zip
RUN ls -a
RUN ln -s ./gradle-6.7.1/bin/gradle .
COPY ./r5 .
COPY ./analysis.properties analysis.properties
RUN ./gradle shadowJar
RUN ln -s build/libs/r5-*.jar r5.jar
# Assert that file to run actually exists (as java won't explicitly ecpress the error)
RUN test -e r5.jar
EXPOSE 7070
CMD /wait && java -Xmx${JVM_HEAP_GB}g -cp r5.jar com.conveyal.analysis.BackendMain