From 282f3b06320e997f4c7ce170df2770f62fc6d22a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?=
<15040126243@163.com>
Date: Tue, 6 Jul 2021 14:06:25 +0800
Subject: [PATCH] =?UTF-8?q?add=20=E5=A2=9E=E5=8A=A0=20docker=20=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docker/.env | 2 ++
docker/docker-compose.yml | 3 ++-
pom.xml | 6 ++++++
ruoyi-admin/Dockerfile | 13 +++++++++++++
ruoyi-admin/pom.xml | 23 +++++++++++++++++++++--
5 files changed, 44 insertions(+), 3 deletions(-)
create mode 100644 docker/.env
create mode 100644 ruoyi-admin/Dockerfile
diff --git a/docker/.env b/docker/.env
new file mode 100644
index 00000000..8e947ae8
--- /dev/null
+++ b/docker/.env
@@ -0,0 +1,2 @@
+REGISTER=ruoyi
+TAG=2.4.0
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 0da30320..b7d70a06 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -84,7 +84,8 @@ services:
privileged: true
restart: always
networks:
- - ruoyi_net
+ ruoyi_net:
+ ipv4_address: 172.30.0.60
networks:
ruoyi_net:
diff --git a/pom.xml b/pom.xml
index 10a35d2c..d71181b1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,6 +32,12 @@
3.16.0
2.2.1
3.4.0
+
+
+ localhost
+ http://${docker.registry.url}:2375
+ ruoyi
+ 1.2.0
diff --git a/ruoyi-admin/Dockerfile b/ruoyi-admin/Dockerfile
new file mode 100644
index 00000000..a3c4dc14
--- /dev/null
+++ b/ruoyi-admin/Dockerfile
@@ -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"]
diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml
index f33a5d4c..1855b610 100644
--- a/ruoyi-admin/pom.xml
+++ b/ruoyi-admin/pom.xml
@@ -24,7 +24,7 @@
true
-
+
mysql
mysql-connector-java
@@ -82,7 +82,26 @@
false
${project.artifactId}
-
+
+
+ com.spotify
+ docker-maven-plugin
+ ${docker.plugin.version}
+
+ ${docker.namespace}/${project.artifactId}:${project.version}
+ ${project.basedir}
+ ${docker.registry.host}
+ ${docker.registry.url}
+ ${docker.registry.url}
+
+
+ /
+ ${project.build.directory}
+ ${project.build.finalName}.jar
+
+
+
+