Compile fresh backend when building docker image
All checks were successful
Java CI with Maven / build (push) Successful in 44s
All checks were successful
Java CI with Maven / build (push) Successful in 44s
This commit is contained in:
parent
55d2d4936e
commit
281d37cf0b
@ -1,9 +1,15 @@
|
||||
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
|
||||
|
||||
|
||||
FROM openjdk:17-jdk-alpine
|
||||
RUN addgroup -S spring && adduser -S spring -G spring
|
||||
USER spring:spring
|
||||
|
||||
ARG JAR_FILE=target/*.jar
|
||||
COPY ${JAR_FILE} app.jar
|
||||
|
||||
#ARG JAR_FILE=target/*.jar
|
||||
#COPY ${JAR_FILE} app.jar
|
||||
COPY --from=build /home/app/target/*.jar app.jar
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java","-jar","/app.jar"]
|
Loading…
Reference in New Issue
Block a user