generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixing datasource for MultiFlywayConfig
- Loading branch information
1 parent
3460063
commit d5916cd
Showing
1 changed file
with
28 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,43 @@ | ||
### Builder | ||
FROM ghcr.io/graalvm/native-image:22.3.3 AS build | ||
FROM eclipse-temurin:17.0.8.1_1-jdk-jammy AS build | ||
|
||
# Install Maven | ||
RUN apt update -y && \ | ||
apt install -y wget tar && \ | ||
wget https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz && \ | ||
tar xzf apache-maven-3.8.6-bin.tar.gz -C /opt && \ | ||
ln -s /opt/apache-maven-3.8.6 /opt/maven && \ | ||
ln -s /opt/maven/bin/mvn /usr/bin/mvn && \ | ||
rm apache-maven-3.8.6-bin.tar.gz && \ | ||
apt-get clean | ||
|
||
# Add Maven to the PATH environment variable | ||
ENV MAVEN_HOME=/opt/maven | ||
ENV PATH=$MAVEN_HOME/bin:$PATH | ||
|
||
# Receiving app version | ||
ARG APP_VERSION=0.0.1 | ||
|
||
# Copy | ||
WORKDIR /app | ||
COPY pom.xml mvnw ./ | ||
COPY pom.xml ./ | ||
COPY src ./src | ||
COPY .mvn/ ./.mvn | ||
COPY InstallCert.java . | ||
|
||
# Build | ||
RUN ./mvnw package -Pnative -DskipTests -Dskip.unit.tests=true -Dspring-boot.run.profiles=prod | ||
RUN mvn clean package -DskipTests -Dtests.skip=true -Dskip.unit.tests=true | ||
|
||
### Deployer | ||
FROM eclipse-temurin:17.0.12_7-jdk-jammy AS deploy | ||
FROM eclipse-temurin:17.0.8.1_1-jre-jammy AS deploy | ||
ARG PORT=3100 | ||
|
||
# Copy | ||
WORKDIR /app | ||
COPY --from=build /app/target/*.jar /app/*.class ./artifacts/ | ||
COPY dockerfile-entrypoint.sh ./ | ||
RUN mkdir config dump public && \ | ||
chmod -R g+w . && \ | ||
chmod g+x dockerfile-entrypoint.sh && \ | ||
chmod g+w ${JAVA_HOME}/lib/security/cacerts | ||
|
||
# Port and health check | ||
COPY --from=build /app/target/nr-results-backend.jar ./nr-results-backend.jar | ||
|
||
# User, port and health check | ||
USER 1001 | ||
EXPOSE 8080 | ||
HEALTHCHECK CMD curl -f http://localhost:8080/actuator/health | grep '"status":"UP"' | ||
EXPOSE ${PORT} | ||
HEALTHCHECK CMD curl -f http://localhost:${PORT}/actuator/health | grep '"status":"UP"' | ||
|
||
# Startup | ||
ENTRYPOINT ["/app/dockerfile-entrypoint.sh"] | ||
ENTRYPOINT ["java", "-jar","/app/nr-results-backend.jar","--spring.profiles.active=prod"] |