-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
40 lines (34 loc) · 1.24 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
FROM maven:3.9.8-amazoncorretto-21 AS build
WORKDIR /app
COPY . .
RUN mvn clean package -s settings.xml -DskipTests
FROM amazoncorretto:21
WORKDIR /app
COPY --from=build /app/oppijanumerorekisteri-service/target/oppijanumerorekisteri-service-*SNAPSHOT.jar oppijanumerorekisteri.jar
COPY --chmod=755 <<"EOF" /app/entrypoint.sh
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
echo -n ${vtjkysely_truststore_base64} | base64 --decode > /app/vtjkysely-truststore
echo -n ${vtjkysely_keystore_base64} | base64 --decode > /app/vtjkysely-keystore
exec java \
-Dlog4j2.formatMsgNoLookups=true \
-XX:MaxDirectMemorySize=256m \
-XX:+AlwaysPreTouch \
-XX:CompressedClassSpaceSize=256m \
-XX:MaxMetaspaceSize=512m \
-XX:+UnlockDiagnosticVMOptions \
-XX:NativeMemoryTracking=summary \
-XX:+PrintNMTStatistics \
-Xms6g \
-Xmx6g \
-Dspring.config.additional-location=classpath:/config/oppijanumerorekisteri.yml,classpath:/config/$ENV.yml \
-Denv.name=$ENV \
-Dlogging.config=classpath:/config/logback.xml \
-Dserver.port=8080 \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED \
-Dnet.bytebuddy.experimental=true \
-jar \
oppijanumerorekisteri.jar
EOF
ENTRYPOINT [ "/app/entrypoint.sh" ]