2023-11-13 18:39:25 +01:00
|
|
|
FROM maven:3.8.1-openjdk-17-slim AS build
|
|
|
|
COPY src /home/app/src
|
|
|
|
COPY pom.xml /home/app
|
|
|
|
RUN mvn -f /home/app/pom.xml clean test package
|
|
|
|
|
|
|
|
|
2023-09-25 11:01:28 +02:00
|
|
|
FROM openjdk:17-jdk-alpine
|
|
|
|
RUN addgroup -S spring && adduser -S spring -G spring
|
|
|
|
USER spring:spring
|
|
|
|
|
2023-11-13 18:39:25 +01:00
|
|
|
#ARG JAR_FILE=target/*.jar
|
|
|
|
#COPY ${JAR_FILE} app.jar
|
|
|
|
COPY --from=build /home/app/target/*.jar app.jar
|
2023-09-25 11:01:28 +02:00
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["java","-jar","/app.jar"]
|