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 ####################################### ####################################### 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 MAVEN_ACCOUNT_USR
ARG CITE_MAVEN_ACCOUNT_PSW 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 pom.xml /build/
COPY annotation /build/annotation/ COPY annotation /build/annotation/
@ -15,12 +20,15 @@ RUN rm -f /build/annotation-web/src/main/resources/certificates/*.crt
WORKDIR /build/ 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 # 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 ######################################## ######################################## 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 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> </pluginGroups>
<servers> <servers>
<server> <server>
<id>cite-maven</id> <id>dev</id>
<username>${server.username}</username> <username>${server_username}</username>
<password>${server.password}</password> <password>${server_password}</password>
</server> </server>
</servers> </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> </settings>