FROM maven:3-eclipse-temurin-21 as build
WORKDIR /{{artifactId}}
COPY pom.xml pom.xml
COPY src src
COPY conf conf
RUN mvn package

FROM eclipse-temurin:21-jdk
WORKDIR /{{artifactId}}
{{#if stork}}
COPY --from=build /{{artifactId}}/target/stork .
{{else}}
COPY --from=build /{{artifactId}}/target/{{finalArtifactId}} app.jar
COPY conf conf
{{/if}}
EXPOSE 8080
{{#if stork}}
CMD ["bin/{{artifactId}}", "--run"]
{{else}}
CMD ["java", "-jar", "app.jar"]
{{/if}}
