mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 04:55:50 +00:00
Adding Dockerfile
This commit is contained in:
parent
e9836e634a
commit
4919b1daf9
3 changed files with 60 additions and 0 deletions
27
pom.xml
27
pom.xml
|
@ -29,4 +29,31 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.spotify</groupId>
|
||||||
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
|
<version>0.4.13</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>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.7</java.version>
|
<java.version>1.7</java.version>
|
||||||
|
|
||||||
|
<docker.image.prefix>arey</docker.image.prefix>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -121,6 +123,29 @@
|
||||||
</generateGitPropertiesFilename>
|
</generateGitPropertiesFilename>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.spotify</groupId>
|
||||||
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
|
<version>0.4.13</version>
|
||||||
|
<configuration>
|
||||||
|
<imageName>${docker.image.prefix}/springboot-petclinic</imageName>
|
||||||
|
<dockerDirectory>src/main/docker</dockerDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<targetPath>/</targetPath>
|
||||||
|
<directory>${project.build.directory}</directory>
|
||||||
|
<include>${project.build.finalName}.jar</include>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<forceTags>true</forceTags>
|
||||||
|
<imageTags>
|
||||||
|
<imageTag>${project.version}</imageTag>
|
||||||
|
<imageTag>latest</imageTag>
|
||||||
|
</imageTags>
|
||||||
|
<useConfigFile>true</useConfigFile>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
8
springboot-petclinic-server/src/main/docker/Dockerfile
Normal file
8
springboot-petclinic-server/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.jar petclinic.jar
|
||||||
|
RUN sh -c 'touch /petclinic.jar'
|
||||||
|
# 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.jar"]
|
Loading…
Reference in a new issue