-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 1.03 KB
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 1.03 KB
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
FROM maven:3.9-eclipse-temurin-25 AS build
WORKDIR /app/build
COPY . ./
RUN mvn -B package -P git-commit
RUN cp ninbot-app/target/ninbot-*.jar ninbot.jar
RUN java -Djarmode=tools -jar ninbot.jar extract --layers --launcher
FROM eclipse-temurin:25-jre-noble
LABEL maintainer="Nincodedo"
LABEL source="https://github.com/Nincodedo/Ninbot"
LABEL org.opencontainers.image.source="https://github.com/Nincodedo/Ninbot"
WORKDIR /home/app
RUN groupadd -r ninbot \
&& useradd -r -s /bin/false -g ninbot ninbot \
&& chown -hR ninbot:ninbot /home/app
USER ninbot:ninbot
COPY --chmod=755 health-check DockerHealthCheck.java ./
COPY --from=build /app/build/ninbot/dependencies/ ./
COPY --from=build /app/build/ninbot/spring-boot-loader/ ./
COPY --from=build /app/build/ninbot/snapshot-dependencies/ ./
COPY --from=build /app/build/ninbot/application/ ./
HEALTHCHECK --start-period=20s CMD ["/home/app/health-check"]
EXPOSE 8080
ENTRYPOINT ["java"]
CMD ["-Xss512k", "-Xmx256M", "--enable-preview", "org.springframework.boot.loader.launch.JarLauncher"]