add 增加 docker 配置

feature/model
疯狂的狮子li 3 years ago
parent 80e74eb91c
commit 282f3b0632

@ -0,0 +1,2 @@
REGISTER=ruoyi
TAG=2.4.0

@ -84,7 +84,8 @@ services:
privileged: true
restart: always
networks:
- ruoyi_net
ruoyi_net:
ipv4_address: 172.30.0.60
networks:
ruoyi_net:

@ -32,6 +32,12 @@
<redisson.version>3.16.0</redisson.version>
<lock4j.version>2.2.1</lock4j.version>
<datasource.version>3.4.0</datasource.version>
<!-- docker 配置 -->
<docker.registry.url>localhost</docker.registry.url>
<docker.registry.host>http://${docker.registry.url}:2375</docker.registry.host>
<docker.namespace>ruoyi</docker.namespace>
<docker.plugin.version>1.2.0</docker.plugin.version>
</properties>
<!-- 依赖声明 -->

@ -0,0 +1,13 @@
FROM anapsix/alpine-java:8_server-jre_unlimited
MAINTAINER Lion Li
RUN mkdir -p /ruoyi/admin
WORKDIR /ruoyi/admin
EXPOSE 8080
ADD ./target/ruoyi-admin.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]

@ -24,7 +24,7 @@
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- Mysql驱动包 -->
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
@ -82,7 +82,26 @@
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.plugin.version}</version>
<configuration>
<imageName>${docker.namespace}/${project.artifactId}:${project.version}</imageName>
<dockerDirectory>${project.basedir}</dockerDirectory>
<dockerHost>${docker.registry.host}</dockerHost>
<registryUrl>${docker.registry.url}</registryUrl>
<serverId>${docker.registry.url}</serverId>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>

Loading…
Cancel
Save