-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
23 lines (22 loc) · 939 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
####
## run Maven build in Docker image layer and cache dependencies
####
FROM maven:3-jdk-11 as builder
# setup base dir
WORKDIR /usr/src/app
# copy files from project
COPY pom.xml pom.xml
COPY src/ src/
# 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:11-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-demo-data.jar ${WORKDIR}
# run the application
ENTRYPOINT ["java","-Dspring.profiles.active=${PROFILES}","-Dserver.port=${PORT}","-Djava.security.egd=file:/dev/./urandom","-jar","/usr/src/app/camunda-demo-data.jar"]