Squashed commit of the following:
commit 0d624137c2557c6eeb87020749e4977b821c2b5c Author: Adrien <adrien.cesaro@proton.me> Date: Thu Apr 9 11:55:22 2026 +0200 backend native image setup
This commit is contained in:
@@ -143,12 +143,97 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.graalvm.buildtools</groupId>
|
||||
<artifactId>native-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<!-- Jib — package native executable (or fat-jar) into Docker image -->
|
||||
<plugin>
|
||||
<groupId>com.google.cloud.tools</groupId>
|
||||
<artifactId>jib-maven-plugin</artifactId>
|
||||
<version>3.4.5</version>
|
||||
<configuration>
|
||||
<from>
|
||||
<!-- distroless glibc base — matches GraalVM native binary ABI on Linux x86_64 -->
|
||||
<image>gcr.io/distroless/base-nossl-debian12</image>
|
||||
</from>
|
||||
<to>
|
||||
<!-- override at build time: -Djib.to.image=registry/org/image:tag -->
|
||||
<image>ai-teacher-backend</image>
|
||||
</to>
|
||||
<container>
|
||||
<ports>
|
||||
<port>8080</port>
|
||||
</ports>
|
||||
</container>
|
||||
<pluginExtensions>
|
||||
<pluginExtension>
|
||||
<implementation>
|
||||
com.google.cloud.tools.jib.maven.extension.nativeimage.JibNativeImageExtension
|
||||
</implementation>
|
||||
</pluginExtension>
|
||||
</pluginExtensions>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.cloud.tools</groupId>
|
||||
<artifactId>jib-native-image-extension-maven</artifactId>
|
||||
<version>0.1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>native</id>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
<!-- GraalVM native-image compilation -->
|
||||
<plugin>
|
||||
<groupId>org.graalvm.buildtools</groupId>
|
||||
<artifactId>native-maven-plugin</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-reachability-metadata</id>
|
||||
<goals>
|
||||
<goal>add-reachability-metadata</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<goals>
|
||||
<goal>compile-no-fork</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<imageName>ai-teacher-backend</imageName>
|
||||
<buildArgs>
|
||||
<buildArg>--initialize-at-build-time=org.slf4j,ch.qos.logback</buildArg>
|
||||
<buildArg>-H:+ReportExceptionStackTraces</buildArg>
|
||||
<buildArg>--gc=serial</buildArg>
|
||||
<buildArg>-Os</buildArg>
|
||||
<buildArg>-H:+RemoveUnusedSymbols</buildArg>
|
||||
<buildArg>-H:-EnableLoggingFeature</buildArg>
|
||||
<buildArg>-R:MaxHeapSize=128m</buildArg>
|
||||
<buildArg>-R:MinHeapSize=32m</buildArg>
|
||||
</buildArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user