Skip to content

Commit

Permalink
Fixes #229 - Add docker module (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Jul 24, 2024
1 parent 05a2091 commit d0ce6c3
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 1 deletion.
112 changes: 112 additions & 0 deletions docker/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.manorrock.persian</groupId>
<artifactId>project</artifactId>
<version>23.8.0-SNAPSHOT</version>
</parent>
<artifactId>persian-docker</artifactId>
<packaging>pom</packaging>
<name>Manorrock Persian - Docker</name>
<build>
<finalName>persian-docker</finalName>
</build>
<profiles>
<profile>
<id>docker</id>
<dependencies>
<dependency>
<groupId>com.manorrock.persian</groupId>
<artifactId>persian</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<type>war</type>
</dependency>
<dependency>
<groupId>com.manorrock.persian</groupId>
<artifactId>persian-ui</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.7.1</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.manorrock.persian</groupId>
<artifactId>persian</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/wars</outputDirectory>
<destFileName>persian.war</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.manorrock.persian</groupId>
<artifactId>persian-ui</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/wars</outputDirectory>
<destFileName>persian-ui.war</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/wars</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker-maven-plugin.version}</version>
<configuration>
<images>
<image>
<alias>persian</alias>
<name>ghcr.io/manorrock/persian:%l</name>
<build>
<buildx>
<platforms>
<platform>linux/amd64</platform>
<platform>linux/arm64</platform>
</platforms>
</buildx>
<contextDir>${basedir}</contextDir>
<dockerFile>src/main/docker/Dockerfile</dockerFile>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build</id>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
8 changes: 8 additions & 0 deletions docker/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ghcr.io/piranhacloud/platform:latest
COPY target/wars/persian.war /home/piranha/piranha/webapps/repo.war
COPy target/wars/persian-ui.war /home/piranha/piranha/webapps/ui.war
USER root
RUN chown -R piranha:piranha /home/piranha
WORKDIR /home/piranha/piranha/bin
USER piranha
CMD ["/bin/bash", "./run.sh"]
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
<properties>
<!-- other -->
<piranha.version>24.7.0</piranha.version>
<!-- plugins -->
<docker-maven-plugin.version>0.42.1</docker-maven-plugin.version>
</properties>
<modules>
<module>docker</module>
<module>repo</module>
<module>ui</module>
</modules>
Expand Down
1 change: 0 additions & 1 deletion ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<!--<piranha.jvmArguments>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000</piranha.jvmArguments>-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- plugins -->
<docker-maven-plugin.version>0.42.1</docker-maven-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-war-plugin.version>3.4.0</maven-war-plugin.version>
</properties>
Expand Down

0 comments on commit d0ce6c3

Please sign in to comment.