## Build stage ##
FROM default-route-openshift-image-registry.apps.desplakur3.desintra.banesco.com/runners-gitlab/openjdk-17:1.20-2.1721752931 AS build
COPY . /home/default/
COPY pom.xml /home/default
COPY settings.xml /home/default
RUN mvn -s /home/default/settings.xml -f /home/default/pom.xml -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true -DskipTests=true clean package
RUN ls -ltra /home/default/target/

### Package stage ###
FROM default-route-openshift-image-registry.apps.desplakur3.desintra.banesco.com/runners-gitlab/openjdk-17:1.20-2.1721752931
WORKDIR /home/default
CMD ["ls"]
COPY --from=build /home/default/target/*.jar app.jar
CMD ["java","-jar","app.jar"]
