Skip to content

Commit

Permalink
chore: trying to fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
paulushcgcj committed Oct 25, 2024
1 parent e0fbf6b commit 98ea3ea
Show file tree
Hide file tree
Showing 12 changed files with 706 additions and 102 deletions.
26 changes: 7 additions & 19 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@
### Builder
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
FROM ghcr.io/graalvm/native-image:22.3.3 AS build

# Copy
WORKDIR /app
COPY pom.xml ./
COPY pom.xml mvnw ./
COPY src ./src
COPY .mvn/ ./.mvn
COPY InstallCert.java .

# Build
RUN mvn clean package -DskipTests -Dskip.unit.tests=true -Dspring-boot.run.profiles=prod
RUN ./mvnw package -Pnative -DskipTests -Dskip.unit.tests=true -Dspring-boot.run.profiles=prod

### Deployer
FROM eclipse-temurin:17.0.12_7-jdk-jammy AS deploy

# Copy
WORKDIR /app
COPY --from=build /app/target/nr-results-backend.jar ./artifacts/nr-results-backend.jar
COPY --from=build /app/target/*.jar /app/*.class ./artifacts/
COPY dockerfile-entrypoint.sh ./
RUN mkdir config dump public && \
chmod -R g+w . && \
Expand All @@ -41,4 +29,4 @@ EXPOSE 8080
HEALTHCHECK CMD curl -f http://localhost:8080/actuator/health | grep '"status":"UP"'

# Startup
ENTRYPOINT ["/app/dockerfile-entrypoint.sh"]
ENTRYPOINT ["/app/dockerfile-entrypoint.sh"]
27 changes: 8 additions & 19 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<optional>true</optional>
</dependency>
<dependency>
Expand All @@ -151,6 +150,7 @@
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc11</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
Expand All @@ -168,6 +168,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
Expand All @@ -176,8 +177,8 @@
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>oracle-xe</artifactId>
<version>1.20.2</version>
<artifactId>oracle-free</artifactId>
<version>1.20.0</version>
<scope>test</scope>
</dependency>

Expand All @@ -187,11 +188,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
Expand Down Expand Up @@ -233,14 +229,8 @@

<!-- Validation -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>7.0.4.Final</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
</dependencies>

Expand Down Expand Up @@ -271,6 +261,8 @@
</executions>
</plugin>



<!--
Spring Boot: Packaging and running
More: https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/htmlsingle/
Expand All @@ -285,9 +277,6 @@
<artifactId>lombok</artifactId>
</exclude>
</excludes>
<profiles>
<profile>dev</profile>
</profiles>
</configuration>
</plugin>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
"jni-config.json",
"proxy-config.json",
"reflect-config.json"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"condition": {
"typeReachable": "java.lang.ClassLoader"
},
"name": "java.lang.ClassLoader",
"methods": [
{
"name": "getPlatformClassLoader",
"parameterTypes": []
},
{
"name": "loadClass",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"condition": {
"typeReachable": "jdk.internal.loader.ClassLoaders"
},
"name": "jdk.internal.loader.ClassLoaders$PlatformClassLoader"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"condition": {
"typeReachable": "com.zaxxer.hikari.pool.ProxyConnection$ClosedConnection"
},
"interfaces": [
"java.sql.Connection"
]
}
]
Loading

0 comments on commit 98ea3ea

Please sign in to comment.