-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
26 lines (18 loc) · 939 Bytes
/
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
FROM azul/zulu-openjdk-alpine:21-jre-headless as builder
WORKDIR app
ARG JAR_FILE=target/distributed-counter-0.1.2-SNAPSHOT.jar
COPY ${JAR_FILE} app.jar
RUN java -Djarmode=layertools -jar app.jar extract
FROM azul/zulu-openjdk-alpine:21-jre-headless
USER nobody
WORKDIR app
# REST port
EXPOSE 8080/tcp
# Hazelcast port
EXPOSE 5701/tcp
ENV HAZELCAST_JAVA_OPTS="--add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED"
COPY --from=builder app/dependencies/ ./
COPY --from=builder app/spring-boot-loader/ ./
COPY --from=builder app/snapshot-dependencies/ ./
COPY --from=builder app/application/ ./
ENTRYPOINT exec java $HAZELCAST_JAVA_OPTS $JAVA_OPTS "org.springframework.boot.loader.launch.JarLauncher"