Skip to content
Snippets Groups Projects
Commit b96e1093 authored by Antoine Rey's avatar Antoine Rey
Browse files

Add a Dockefile and configure the docker-maven-plugin

parent 86458070
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.samples</groupId>
<artifactId>springboot-petclinic</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
......@@ -19,6 +19,7 @@
<java.version>1.7</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<docker.image.prefix>arey</docker.image.prefix>
<!-- Dates -->
<jodatime-hibernate.version>1.3</jodatime-hibernate.version>
......@@ -313,6 +314,28 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.11</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.war</include>
</resource>
</resources>
<forceTags>true</forceTags>
<imageTags>
<imageTag>${project.version}</imageTag>
<imageTag>latest</imageTag>
</imageTags>
<useConfigFile>true</useConfigFile>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
......
FROM openjdk:alpine
MAINTAINER Antoine Rey <antoine.rey@free.fr>
# Spring Boot application creates working directories for Tomcat by default
VOLUME /tmp
ADD petclinic.war petclinic.war
RUN sh -c 'touch /petclinic.war'
# To reduce Tomcat startup time we added a system property pointing to "/dev/urandom" as a source of entropy.
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/petclinic.war"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment