Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #373 - Add Dockerfile for Azure Storage #374

Merged
merged 1 commit into from Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 5 additions & 9 deletions azure-storage/pom.xml
Expand Up @@ -70,7 +70,6 @@
<release>${java.version}</release>
</configuration>
</plugin>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
Expand All @@ -93,7 +92,6 @@
</systemPropertyVariables>
</configuration>
</plugin>
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
Expand All @@ -102,16 +100,15 @@
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<!--
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker-maven-plugin.version}</version>
<configuration>
<images>
<image>
<alias>ocelot-azure-keyvault</alias>
<name>ghcr.io/manorrock/ocelot-azure-appconfig:%l</name>
<alias>ocelot-azure-storage</alias>
<name>ghcr.io/manorrock/ocelot-azure-storage:%l</name>
<build>
<buildx>
<platforms>
Expand All @@ -124,8 +121,8 @@
</build>
<run>
<ports>
<port>8101:8101</port>
<port>8201:8201</port>
<port>8103:8103</port>
<port>8203:8203</port>
</ports>
<volumes>
<bind>
Expand All @@ -134,7 +131,7 @@
</volumes>
<wait>
<http>
<url>http://localhost:8101/</url>
<url>http://localhost:8103/ping</url>
</http>
<time>20000</time>
</wait>
Expand Down Expand Up @@ -174,7 +171,6 @@
</execution>
</executions>
</plugin>
-->
</plugins>
</build>
</project>
8 changes: 8 additions & 0 deletions 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"]
6 changes: 6 additions & 0 deletions 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
34 changes: 34 additions & 0 deletions 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";
}
}
13 changes: 13 additions & 0 deletions 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 {
}
7 changes: 7 additions & 0 deletions azure-storage/src/main/webapp/WEB-INF/beans.xml
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd"
bean-discovery-mode="all">
</beans>
Binary file added azure-storage/src/test/certs/keystore
Binary file not shown.