-
Notifications
You must be signed in to change notification settings - Fork 28
/
Dockerfile
42 lines (32 loc) · 1.07 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM amazoncorretto:21-alpine AS corretto-deps
COPY ./backend/build/libs/gitactionboard.jar /app/
RUN unzip /app/gitactionboard.jar -d temp && \
jdeps \
--print-module-deps \
--ignore-missing-deps \
--recursive \
--multi-release 17 \
--class-path="./temp/BOOT-INF/lib/*" \
--module-path="./temp/BOOT-INF/lib/*" \
/app/gitactionboard.jar > /modules.txt
FROM amazoncorretto:21-alpine AS corretto-jdk
COPY --from=corretto-deps /modules.txt /modules.txt
# hadolint ignore=DL3018
RUN apk add --no-cache binutils && \
jlink \
--verbose \
--add-modules "$(cat /modules.txt),jdk.crypto.ec,jdk.crypto.cryptoki,jdk.management" \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /jre
FROM alpine:3.20.3
ENV JAVA_HOME=/jre
ENV PATH="${JAVA_HOME}/bin:${PATH}"
RUN apk upgrade libssl3 libcrypto3
COPY --from=corretto-jdk /jre $JAVA_HOME
EXPOSE 8080
COPY ./backend/build/libs/gitactionboard.jar /app/
WORKDIR /app
CMD ["java", "-jar", "gitactionboard.jar"]