-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathd.springboot.Dockerfile
70 lines (52 loc) · 2.57 KB
/
d.springboot.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# This Dockerfile is divided in 3 stages:
# 1. Builder image for the KJAR.
# 2. Builder image for the executable Spring Boot fat jar.
# 3. Executable image with just the JDK and the app fat jar.
#
# dependency:go-offline does not resolve transitive BOM (from drools-bom), therefore '--offline' does not work.
### DEPENDENCIES BUILDER IMAGE ###
FROM docker.io/maven:3-jdk-11-slim as builder-deps
### Choose to build the dependencies or let them resolve from Maven Central.
### rhpam-dependencies
#COPY rhpam-dependencies/pom.xml /build/rhpam-dependencies/
#RUN mvn --batch-mode --file build/rhpam-dependencies/pom.xml install
### rhpam-event-listener
# COPY rhpam-event-listener/pom.xml /build/rhpam-event-listener/
# RUN mvn --batch-mode --file build/rhpam-event-listener/pom.xml dependency:go-offline
# COPY rhpam-event-listener/src /build/rhpam-event-listener/src/
# RUN mvn --batch-mode --define skipTests --file build/rhpam-event-listener/pom.xml install
### rhpam-kjar
COPY rhpam-kjar/pom.xml /build/rhpam-kjar/
RUN mvn --batch-mode --file build/rhpam-kjar/pom.xml dependency:go-offline
COPY rhpam-kjar/src /build/rhpam-kjar/src/
RUN mvn --batch-mode --define skipTests --file build/rhpam-kjar/pom.xml install
### APP BUILDER IMAGE ###
FROM docker.io/maven:3-jdk-11-slim as builder-app
COPY rhpam-springboot/pom.xml /build/
RUN mvn --batch-mode --file build/pom.xml dependency:go-offline
COPY rhpam-springboot/src /build/src/
RUN mvn --batch-mode --define skipTests --file build/pom.xml package \
&& mkdir app \
&& mv build/target/*.jar app/app.jar
COPY rhpam-springboot/rhpam-springboot.xml /app/
### EXECUTABLE IMAGE ###
FROM docker.io/openjdk:11-jre-slim
ARG CREATED_AT=none
ARG GITHUB_SHA=none
LABEL org.opencontainers.image.created="$CREATED_AT"
LABEL org.opencontainers.image.revision="$GITHUB_SHA"
LABEL org.opencontainers.image.title="RHPAM Quickstart Spring Boot"
LABEL org.opencontainers.image.description="Red Hat Process Automation Quickstart Application with KIE Server in Spring Boot."
LABEL org.opencontainers.image.url="https://github/juliaaano/rhpam-quickstart"
LABEL org.opencontainers.image.source="[email protected]:juliaaano/rhpam-quickstart"
LABEL org.opencontainers.image.documentation="https://github/juliaaano/rhpam-quickstart"
LABEL org.opencontainers.image.authors="juliaaano"
LABEL org.opencontainers.image.vendor="juliaaano"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.version="1.1.0"
COPY --from=builder-deps /root/.m2/repository /root/.m2/repository/
COPY --from=builder-app app app/
WORKDIR /app
EXPOSE 8090
CMD ["java", "-jar", "app.jar"]