forked from concretesolutions/mock-api
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
43 lines (31 loc) · 895 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
37
38
39
40
41
42
43
FROM openjdk:8-jdk as build
ENV BUILD_PATH /building
WORKDIR $BUILD_PATH
COPY gradlew $BUILD_PATH/
COPY gradle $BUILD_PATH/gradle
# download gradle
RUN ./gradlew --continue
COPY build.gradle $BUILD_PATH
# download dependencies
RUN ./gradlew build; exit 0
COPY src $BUILD_PATH/src
COPY mocks-test $BUILD_PATH/mocks-test
RUN mkdir $BUILD_PATH/backup-temp
RUN ./gradlew build
#############
# Final image
FROM openjdk:8-jdk
MAINTAINER "elemental-source"
VOLUME /config
VOLUME /mocks-test
VOLUME /backup-temp
WORKDIR /
EXPOSE 5000
EXPOSE 9090
ENV APP_PARAMS "--spring.config.location=file:/config/application.yml"
COPY --from=build /building/build/libs/*.jar app.jar
ENTRYPOINT ["java", \
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5000 -Djava.security.egd=file:/dev/./urandom", \
"-jar", \
"/app.jar", \
"$APP_PARAMS"]