Added config/assets to build a docker-image
authorKai Moritz <kai@juplo.de>
Sun, 13 Jun 2021 09:26:00 +0000 (11:26 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 19 Jun 2021 15:40:30 +0000 (17:40 +0200)
.dockerignore [new file with mode: 0644]
Dockerfile [new file with mode: 0644]
pom.xml

diff --git a/.dockerignore b/.dockerignore
new file mode 100644 (file)
index 0000000..1ad9963
--- /dev/null
@@ -0,0 +1,2 @@
+*
+!target/*.jar
diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..50394b6
--- /dev/null
@@ -0,0 +1,4 @@
+FROM openjdk:11-jre-slim
+COPY target/transfer-1.0.0.jar /opt/transfer.jar
+EXPOSE 8080
+CMD ["java", "-jar", "/opt/transfer.jar"]
diff --git a/pom.xml b/pom.xml
index 8c2c36b..df51758 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -21,6 +21,7 @@
     <java.version>11</java.version>
     <confluent.version>6.2.0</confluent.version>
     <kafka.version>2.8.0</kafka.version>
+    <docker-maven-plugin.version>0.33.0</docker-maven-plugin.version>
   </properties>
 
   <dependencies>
           </excludes>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>io.fabric8</groupId>
+        <artifactId>docker-maven-plugin</artifactId>
+        <version>${docker-maven-plugin.version}</version>
+        <configuration>
+          <images>
+            <image>
+              <name>juplo/payment-service-demo--%a:%v</name>
+            </image>
+          </images>
+        </configuration>
+        <executions>
+          <execution>
+             <id>build</id>
+             <phase>package</phase>
+             <goals>
+               <goal>build</goal>
+             </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>