Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
application.properties
localhost-env.json
.vscode
certs/

### STS ###
.apt_generated
Expand Down
22 changes: 20 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
FROM openjdk:17.0.2-slim as build
FROM eclipse-temurin:17-ubi9-minimal as build
COPY . /mms
WORKDIR /mms

RUN if [ -d "./certs" ]; then \
mv certs/*.pem /etc/pki/ca-trust/source/anchors/ ; \
/usr/bin/update-ca-trust extract ; \
ln -sf /etc/pki/ca-trust/extracted/java/cacerts "$JAVA_HOME/lib/security/cacerts" ; \
fi

RUN microdnf install -y findutils

RUN ./gradlew --no-daemon bootJar --warning-mode all

RUN find . -type f -name example-*.jar -not -iname '*javadoc*' -not -iname '*sources*' -exec cp '{}' '/app.jar' ';'

FROM eclipse-temurin:17-ubi9-minimal

WORKDIR /opt/mms
COPY --from=build /app.jar /opt/mms/app.jar
COPY --from=build /etc/pki/ca-trust /etc/pki/

ENV JDK_JAVA_OPTIONS "-XX:MaxRAMPercentage=90.0"
ENTRYPOINT ["java", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "-jar", "/app.jar"]
ENV USE_SYSTEM_CA_CERTS "true"

CMD ["java", "-Djdk.tls.client.protocols=TLSv1.2,TLSv1.3", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "-jar", "/opt/mms/app.jar"]
EXPOSE 8080