mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 20:25:50 +00:00
Add a Dockefile and configure the docker-maven-plugin
This commit is contained in:
parent
864580702f
commit
b96e1093d3
2 changed files with 32 additions and 1 deletions
25
pom.xml
25
pom.xml
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.springframework.samples</groupId>
|
<groupId>org.springframework.samples</groupId>
|
||||||
<artifactId>springboot-petclinic</artifactId>
|
<artifactId>springboot-petclinic</artifactId>
|
||||||
<version>1.4.0-SNAPSHOT</version>
|
<version>1.4.0</version>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
@ -19,6 +19,7 @@
|
||||||
<java.version>1.7</java.version>
|
<java.version>1.7</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
<docker.image.prefix>arey</docker.image.prefix>
|
||||||
|
|
||||||
<!-- Dates -->
|
<!-- Dates -->
|
||||||
<jodatime-hibernate.version>1.3</jodatime-hibernate.version>
|
<jodatime-hibernate.version>1.3</jodatime-hibernate.version>
|
||||||
|
@ -313,6 +314,28 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</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>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<reporting>
|
<reporting>
|
||||||
|
|
8
src/main/docker/Dockerfile
Normal file
8
src/main/docker/Dockerfile
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
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"]
|
Loading…
Reference in a new issue