-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hotfix: add health check from actions.
- Loading branch information
1 parent
46689dd
commit b5dbb05
Showing
4 changed files
with
65 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# First stage, build the custom JRE | ||
FROM eclipse-temurin:21-jdk-alpine AS jre-builder | ||
|
||
COPY src /app/src | ||
COPY pom.xml /app | ||
|
||
WORKDIR /app | ||
|
||
ENV MAVEN_VERSION 3.5.4 | ||
ENV MAVEN_HOME /usr/lib/mvn | ||
ENV PATH $MAVEN_HOME/bin:$PATH | ||
|
||
RUN apk update && \ | ||
apk add --no-cache tar binutils maven | ||
|
||
RUN mvn clean package -DskipTests -U \ | ||
&& rm -rf /root/.m2 \ | ||
&& rm -rf /app/src | ||
|
||
RUN jar xvf target/QualityLabPro-0.8.jar | ||
RUN jdeps --ignore-missing-deps -q \ | ||
--recursive \ | ||
--multi-release 21 \ | ||
--print-module-deps \ | ||
--class-path 'BOOT-INF/lib/*' \ | ||
target/QualityLabPro-0.8.jar > modules.txt | ||
|
||
# Build small JRE image | ||
RUN $JAVA_HOME/bin/jlink \ | ||
--verbose \ | ||
--add-modules $(cat modules.txt) \ | ||
--strip-debug \ | ||
--no-man-pages \ | ||
--no-header-files \ | ||
--compress=zip-6 \ | ||
--output /optimized-jdk-21 | ||
|
||
# Second stage, Use the custom JRE and build the app image | ||
FROM alpine:latest | ||
ENV JAVA_HOME=/opt/jdk/jdk-21 | ||
ENV PATH="${JAVA_HOME}/bin:${PATH}" | ||
|
||
# copy JRE from the base image | ||
COPY --from=jre-builder /optimized-jdk-21 $JAVA_HOME | ||
|
||
WORKDIR /usr/src/app | ||
COPY --from=jre-builder /app/target/QualityLabPro-0.8.jar ./app.jar | ||
|
||
ENV SPRING_PROFILES_ACTIVE=prod \ | ||
SERVER_PORT=8080 | ||
|
||
EXPOSE ${SERVER_PORT} |