diff --git a/azure-storage/pom.xml b/azure-storage/pom.xml index 3672fef..c30bc49 100644 --- a/azure-storage/pom.xml +++ b/azure-storage/pom.xml @@ -70,7 +70,6 @@ ${java.version} - org.apache.maven.plugins maven-war-plugin @@ -102,7 +100,6 @@ false - diff --git a/azure-storage/src/main/docker/Dockerfile b/azure-storage/src/main/docker/Dockerfile new file mode 100644 index 0000000..3b4314b --- /dev/null +++ b/azure-storage/src/main/docker/Dockerfile @@ -0,0 +1,8 @@ +FROM ghcr.io/piranhacloud/webprofile:24.3.0 +ADD target/ROOT.war /home/piranha +ADD src/main/docker/startup.sh /home/piranha +WORKDIR /home/piranha +USER piranha +RUN mkdir certs && \ + keytool -genkey -alias self-signed -keyalg RSA -keystore certs/keystore -keysize 4096 -storepass password -dname "CN=localhost" +CMD ["sh", "./startup.sh"] diff --git a/azure-storage/src/main/docker/startup.sh b/azure-storage/src/main/docker/startup.sh new file mode 100644 index 0000000..56cd4da --- /dev/null +++ b/azure-storage/src/main/docker/startup.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# +# Run the application +# +java -jar piranha-dist-webprofile.jar --war-file ROOT.war --http-port 8103 --https-port 8203 --https-keystore-file certs/keystore --https-keystore-password password diff --git a/azure-storage/src/main/java/storage/PingResource.java b/azure-storage/src/main/java/storage/PingResource.java new file mode 100644 index 0000000..5beb9d8 --- /dev/null +++ b/azure-storage/src/main/java/storage/PingResource.java @@ -0,0 +1,34 @@ +package storage; + +import jakarta.inject.Singleton; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; + +/** + * Ping resource. + * + * @author Manfred Riem (mriem@manorrock.com) + */ +@Path("ping") +@Singleton +public class PingResource { + + /** + * Constructor. + */ + public PingResource() { + } + + /** + * Ping. + * + * @return "OK" + */ + @Path(value = "") + @GET + @Produces(value = "text/plain") + public String ping() { + return "OK"; + } +} diff --git a/azure-storage/src/main/java/storage/StorageApplication.java b/azure-storage/src/main/java/storage/StorageApplication.java new file mode 100644 index 0000000..4967858 --- /dev/null +++ b/azure-storage/src/main/java/storage/StorageApplication.java @@ -0,0 +1,13 @@ +package storage; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** + * The Azure Storage application. + * + * @author Manfred Riem (mriem@manorrock.com) + */ +@ApplicationPath("") +public class StorageApplication extends Application { +} diff --git a/azure-storage/src/main/webapp/WEB-INF/beans.xml b/azure-storage/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..a73f48d --- /dev/null +++ b/azure-storage/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,7 @@ + + + + diff --git a/azure-storage/src/test/certs/keystore b/azure-storage/src/test/certs/keystore new file mode 100644 index 0000000..5342ef9 Binary files /dev/null and b/azure-storage/src/test/certs/keystore differ