-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
24 lines (23 loc) · 1 KB
/
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
####
## run Maven build in Docker image layer and cache dependencies
####
FROM maven:3-jdk-8 as builder
# setup base dir
WORKDIR /usr/src/app
# copy files from project
COPY pom.xml pom.xml
COPY src/ src/
# COPY license.txt src/main/resources/camunda-license.txt
# run maven build and cache dependencies
#RUN mvn dependency:resolve-plugins dependency:resolve clean package -DskipTests -Dhttps.protocols=TLSv1.1,TLSv1.2 --activate-profiles !default
RUN --mount=type=cache,target=/root/.m2 mvn -DskipTests -Dmaven.test.skip clean package
####
## create another image layer and run the app that was built
####
FROM openjdk:8-jdk as process-application
# Create app directory
WORKDIR /usr/src/app
# copy the built jar to the new image
COPY --from=builder /usr/src/app/target/camunda-c7-client-1.0.0-SNAPSHOT.jar ${WORKDIR}
# run the application
ENTRYPOINT ["java","-Dspring.profiles.active=${PROFILES}","-Djava.security.egd=file:/dev/./urandom","-Dserver.port=${PORT}","-jar","/usr/src/app/camunda-c7-client-1.0.0-SNAPSHOT.jar"]