turned into a quarkus application
This commit is contained in:
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
**/target
|
||||||
|
.git
|
||||||
|
.idea
|
||||||
|
.mvn
|
||||||
|
*.iml
|
||||||
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
FROM maven:3.9-eclipse-temurin-25 AS build
|
||||||
|
WORKDIR /workspace
|
||||||
|
COPY pom.xml ./
|
||||||
|
COPY agiledancers-be/pom.xml agiledancers-be/pom.xml
|
||||||
|
COPY agiledancers-be/src agiledancers-be/src
|
||||||
|
RUN mvn -B -ntp clean verify
|
||||||
|
|
||||||
|
FROM eclipse-temurin:25-jre
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build --chown=10001:10001 /workspace/agiledancers-be/target/quarkus-app/ ./
|
||||||
|
USER 10001:10001
|
||||||
|
EXPOSE 8080
|
||||||
|
ENTRYPOINT ["java", "-jar", "/app/quarkus-run.jar"]
|
||||||
37
README.md
37
README.md
@@ -1,6 +1,6 @@
|
|||||||
# agiledancers
|
# agiledancers
|
||||||
|
|
||||||
To map dance groups to performance days.
|
To map dance groups to performance days. The backend runs on Quarkus with Java 25.
|
||||||
|
|
||||||
Requires JDK 25 and Maven 3.9.0 or newer. Set `JAVA_HOME` to your JDK 25 installation.
|
Requires JDK 25 and Maven 3.9.0 or newer. Set `JAVA_HOME` to your JDK 25 installation.
|
||||||
|
|
||||||
@@ -9,3 +9,38 @@ Build and run all tests (including `*Sit` tests) from the repository root:
|
|||||||
```sh
|
```sh
|
||||||
mvn clean verify
|
mvn clean verify
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Start development mode with live reload from the repository root:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mvn -pl agiledancers-be quarkus:dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the packaged application after building:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
java -jar agiledancers-be/target/quarkus-app/quarkus-run.jar
|
||||||
|
```
|
||||||
|
|
||||||
|
Build and run a Docker container from the repository root (only Docker is required):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker build -t agiledancers .
|
||||||
|
docker run --rm --name agiledancers -p 8080:8080 agiledancers
|
||||||
|
```
|
||||||
|
|
||||||
|
The Docker build compiles the application and runs the tests in a Maven build stage,
|
||||||
|
then copies the Quarkus application into a Java 25 runtime image running as a non-root user.
|
||||||
|
|
||||||
|
Check readiness at <http://localhost:8080/q/health/ready> or overall health at
|
||||||
|
<http://localhost:8080/q/health>. For example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl --fail http://localhost:8080/q/health/ready
|
||||||
|
```
|
||||||
|
|
||||||
|
Quarkus configuration can be overridden with environment variables, for example
|
||||||
|
`docker run --rm -e QUARKUS_HTTP_PORT=9090 -p 9090:9090 agiledancers`.
|
||||||
|
|
||||||
|
The domain services and repositories retain their existing in-memory behavior;
|
||||||
|
data is lost when the process stops. Business REST endpoints have not yet been added.
|
||||||
|
|||||||
@@ -14,12 +14,26 @@
|
|||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.quarkus</groupId>
|
||||||
|
<artifactId>quarkus-smallrye-health</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.ortools</groupId>
|
<groupId>com.google.ortools</groupId>
|
||||||
<artifactId>ortools-java</artifactId>
|
<artifactId>ortools-java</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- test dependencies -->
|
<!-- test dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.quarkus</groupId>
|
||||||
|
<artifactId>quarkus-junit</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.rest-assured</groupId>
|
||||||
|
<artifactId>rest-assured</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.datafaker</groupId>
|
<groupId>net.datafaker</groupId>
|
||||||
<artifactId>datafaker</artifactId>
|
<artifactId>datafaker</artifactId>
|
||||||
@@ -33,4 +47,24 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>io.quarkus</groupId>
|
||||||
|
<artifactId>quarkus-maven-plugin</artifactId>
|
||||||
|
<version>${quarkus.platform.version}</version>
|
||||||
|
<extensions>true</extensions>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>build</goal>
|
||||||
|
<goal>generate-code</goal>
|
||||||
|
<goal>generate-code-tests</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
quarkus.application.name=agiledancers
|
||||||
|
quarkus.http.host=0.0.0.0
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package nl.agilecc.agiledancers;
|
||||||
|
|
||||||
|
import io.quarkus.test.junit.QuarkusTest;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static io.restassured.RestAssured.given;
|
||||||
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
|
@QuarkusTest
|
||||||
|
class HealthTest {
|
||||||
|
@Test
|
||||||
|
void applicationIsReady() {
|
||||||
|
given()
|
||||||
|
.when().get("/q/health/ready")
|
||||||
|
.then().statusCode(200)
|
||||||
|
.body("status", equalTo("UP"));
|
||||||
|
}
|
||||||
|
}
|
||||||
18
pom.xml
18
pom.xml
@@ -22,18 +22,25 @@
|
|||||||
<maven.compiler.release>25</maven.compiler.release>
|
<maven.compiler.release>25</maven.compiler.release>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
<quarkus.platform.version>3.40.1</quarkus.platform.version>
|
||||||
|
|
||||||
<ortools-java.version>9.15.6755</ortools-java.version>
|
<ortools-java.version>9.15.6755</ortools-java.version>
|
||||||
<lombok.version>1.18.48</lombok.version>
|
<lombok.version>1.18.48</lombok.version>
|
||||||
|
|
||||||
<!-- test dependencies -->
|
<!-- test dependencies -->
|
||||||
<datafaker.version>2.7.0</datafaker.version>
|
<datafaker.version>2.7.0</datafaker.version>
|
||||||
<junit-jupiter.version>6.1.3</junit-jupiter.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- dependencies that can be included by child-project - without stating the version -->
|
<!-- dependencies that can be included by child-project - without stating the version -->
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.quarkus.platform</groupId>
|
||||||
|
<artifactId>quarkus-bom</artifactId>
|
||||||
|
<version>${quarkus.platform.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.ortools</groupId>
|
<groupId>com.google.ortools</groupId>
|
||||||
<artifactId>ortools-java</artifactId>
|
<artifactId>ortools-java</artifactId>
|
||||||
@@ -48,12 +55,6 @@
|
|||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.junit.jupiter</groupId>
|
|
||||||
<artifactId>junit-jupiter</artifactId>
|
|
||||||
<version>${junit-jupiter.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
@@ -88,6 +89,9 @@
|
|||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>3.6.1</version>
|
<version>3.6.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<systemPropertyVariables>
|
||||||
|
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||||
|
</systemPropertyVariables>
|
||||||
<includes>
|
<includes>
|
||||||
<include>**/Test*.java</include>
|
<include>**/Test*.java</include>
|
||||||
<include>**/*Test.java</include>
|
<include>**/*Test.java</include>
|
||||||
|
|||||||
Reference in New Issue
Block a user