|
|
|
@ -57,16 +57,53 @@
|
|
|
|
|
<build>
|
|
|
|
|
<finalName>${project.artifactId}</finalName>
|
|
|
|
|
<plugins>
|
|
|
|
|
<!-- <plugin>-->
|
|
|
|
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
|
|
|
|
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
|
|
|
|
<!-- <executions>-->
|
|
|
|
|
<!-- <execution>-->
|
|
|
|
|
<!-- <goals>-->
|
|
|
|
|
<!-- <goal>repackage</goal>-->
|
|
|
|
|
<!-- </goals>-->
|
|
|
|
|
<!-- </execution>-->
|
|
|
|
|
<!-- </executions>-->
|
|
|
|
|
<!-- </plugin>-->
|
|
|
|
|
|
|
|
|
|
<plugin>
|
|
|
|
|
<groupId>org.springframework.boot</groupId>
|
|
|
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
|
|
|
<executions>
|
|
|
|
|
<execution>
|
|
|
|
|
<goals>
|
|
|
|
|
<goal>repackage</goal>
|
|
|
|
|
</goals>
|
|
|
|
|
</execution>
|
|
|
|
|
</executions>
|
|
|
|
|
<groupId>com.spotify</groupId>
|
|
|
|
|
<artifactId>docker-maven-plugin</artifactId>
|
|
|
|
|
<configuration>
|
|
|
|
|
<!--注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功-->
|
|
|
|
|
<imageName>${project.artifactId}:last</imageName>
|
|
|
|
|
<!--指定基础镜像-->
|
|
|
|
|
<baseImage>openjdk:8-jre</baseImage>
|
|
|
|
|
<!--指定远程docker地址-->
|
|
|
|
|
<!--使用http协议 https 需要加TLS证书-->
|
|
|
|
|
<dockerHost>http://175.178.38.240:8076</dockerHost>
|
|
|
|
|
<!-- <!–配置TLS证书在系统中的路径–>-->
|
|
|
|
|
<!-- <dockerCertPath>/Users/root/docker-ca</dockerCertPath>-->
|
|
|
|
|
<!-- 指定默认挂载地址 -->
|
|
|
|
|
<volumes>/mydata/service/ruoyi</volumes>
|
|
|
|
|
<!-- 创建目录-->
|
|
|
|
|
<runs>mkdir -p /mydata/service/ruoyi</runs>
|
|
|
|
|
<workdir>/mydata/service/ruoyi</workdir>
|
|
|
|
|
<entryPoint>
|
|
|
|
|
["java", "-jar", "-Dspring.profiles.active=dev","/mydata/service/ruoyi/${project.build.finalName}.jar"]
|
|
|
|
|
</entryPoint>
|
|
|
|
|
<!-- <buildArgs>-->
|
|
|
|
|
<!-- <JAR-FILE>target/${project.build.finalName}.jar</JAR-FILE>-->
|
|
|
|
|
<!-- </buildArgs>-->
|
|
|
|
|
<!--复制jar包到docker容器指定目录-->
|
|
|
|
|
<!-- <resources>-->
|
|
|
|
|
<!-- <resource>-->
|
|
|
|
|
<!-- <targetPath>/mydata/service/ruoyi</targetPath>-->
|
|
|
|
|
<!-- <!–jar包在项目中生成的路径,即对应的target目录–>-->
|
|
|
|
|
<!-- <directory>${project.build.directory}</directory>-->
|
|
|
|
|
<!-- <!–指定需要复制的文件–>-->
|
|
|
|
|
<!-- <include>${project.build.finalName}.jar</include>-->
|
|
|
|
|
<!-- </resource>-->
|
|
|
|
|
<!-- </resources>-->
|
|
|
|
|
</configuration>
|
|
|
|
|
</plugin>
|
|
|
|
|
</plugins>
|
|
|
|
|
</build>
|
|
|
|
|