-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaot.Dockerfile
40 lines (25 loc) · 857 Bytes
/
aot.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
# syntax=docker/dockerfile:1
FROM ghcr.io/graalvm/jdk-community:20.0.1 as dependencies
COPY .mvn ./.mvn
COPY mvnw pom.xml ./
COPY core/pom.xml ./core/
COPY webapp/pom.xml ./webapp/
# Installs all dependencies
RUN ./mvnw dependency:go-offline --fail-never
#####
FROM dependencies as modules
COPY webapp ./webapp
COPY core ./core
COPY ./wait-for-it.sh ./entrypoint.sh /
RUN chmod +x /wait-for-it.sh && \
chmod +x /entrypoint.sh
# Package modules into final app, the standard way
FROM modules as setup
RUN ./mvnw clean compile spring-boot:process-aot package -pl webapp,core
# Final image
FROM ghcr.io/graalvm/graalvm-community:20.0.1 as production
COPY ./wait-for-it.sh ./entrypoint.sh /
RUN chmod +x /wait-for-it.sh /entrypoint.sh
COPY --from=setup /app/webapp/target/webapp-*.jar /app/webapp.jar
EXPOSE 25400
ENTRYPOINT ["/entrypoint.sh"]