-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
36 lines (25 loc) · 988 Bytes
/
Dockerfile
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
35
36
#
# build
#
FROM adoptopenjdk:14-jdk-hotspot AS build
# download and cache the version of gradle in use
COPY ./gradle /opt/hedera-proof-of-action/gradle
COPY ./gradlew /opt/hedera-proof-of-action/gradlew
RUN cd /opt/hedera-proof-of-action && ./gradlew --no-daemon
# copy in just enough to cache dependencies
COPY ./build.gradle /opt/hedera-proof-of-action/build.gradle
COPY ./settings.gradle /opt/hedera-proof-of-action/settings.gradle
RUN cd /opt/hedera-proof-of-action && ./gradlew --no-daemon compileJava
# now, finally copy in the source and build a JAR
COPY ./src /opt/hedera-proof-of-action/src
RUN cd /opt/hedera-proof-of-action && ./gradlew --no-daemon build
#
# run
#
FROM adoptopenjdk:14-jre-hotspot
# make a place to put our built JAR and copy it to there
WORKDIR /srv
COPY --from=build /opt/hedera-proof-of-action/build/libs/hedera-proof-of-action.jar /srv/hedera-proof-of-action.jar
# run the micro service
CMD java "-jar" "hedera-proof-of-action.jar"
EXPOSE 8080