fix annotation service Dockerfile

This commit is contained in:
Alexandros Mandilaras 2024-02-20 16:01:31 +02:00
parent 6f1f14a058
commit ece54563d0
2 changed files with 32 additions and 9 deletions

View File

@ -1,8 +1,13 @@
####################################### Build stage #######################################
FROM maven:3.9-eclipse-temurin-17-alpine AS build-stage
FROM maven:3.9-eclipse-temurin-21-alpine AS build-stage
ARG CITE_MAVEN_ACCOUNT_USR
ARG CITE_MAVEN_ACCOUNT_PSW
ARG MAVEN_ACCOUNT_USR
ARG MAVEN_ACCOUNT_PSW
ARG REVISION
ARG PROFILE
ARG DEV_PROFILE_URL
ENV server_username=$MAVEN_ACCOUNT_USR
ENV server_password=$MAVEN_ACCOUNT_PSW
COPY pom.xml /build/
COPY annotation /build/annotation/
@ -15,12 +20,15 @@ RUN rm -f /build/annotation-web/src/main/resources/certificates/*.crt
WORKDIR /build/
RUN mvn -Dserver.username=${CITE_MAVEN_ACCOUNT_USR} -Dserver.password=${CITE_MAVEN_ACCOUNT_PSW} dependency:go-offline
RUN mvn -Drevision=${REVISION} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} dependency:go-offline
# Build project
RUN mvn -Dserver.username=${CITE_MAVEN_ACCOUNT_USR} -Dserver.password=${CITE_MAVEN_ACCOUNT_PSW} clean package
RUN mvn -Drevision=${REVISION} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} clean package
######################################## Run Stage ########################################
FROM eclipse-temurin:17-jre-ubi9-minimal
FROM eclipse-temurin:21-jre-ubi9-minimal
ARG PROFILE
ARG REVISION
COPY --from=build-stage /build/annotation-web/target/sti-viewer-annotation-web.jar /app/sti-viewer-annotation-web.jar

View File

@ -4,9 +4,24 @@
</pluginGroups>
<servers>
<server>
<id>cite-maven</id>
<username>${server.username}</username>
<password>${server.password}</password>
<id>dev</id>
<username>${server_username}</username>
<password>${server_password}</password>
</server>
</servers>
<profiles>
<profile>
<id>dev</id>
<repositories>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repository>
<id>dev</id>
<name>Dev Profile</name>
<url>${devProfileUrl}</url>
</repository>
</repositories>
</profile>
</profiles>
</settings>