docker 打包&生产配置

This commit is contained in:
limqhz
2022-05-14 02:56:22 +08:00
parent a5fa8ba4a2
commit 12ff775d36
4 changed files with 27 additions and 3 deletions

8
Dockerfile Normal file
View File

@@ -0,0 +1,8 @@
FROM java:8
ADD target/quinn-0.0.1-SNAPSHOT.jar /home/monitor-3.1.5.jar
ADD run.sh /home
EXPOSE 8088
ENTRYPOINT [ "sh", "/home/run.sh" ]

15
buildImage Normal file
View File

@@ -0,0 +1,15 @@
-- 修改docker镜像为阿里云镜像 docker-engine增加
"registry-mirrors": [
"https://6kx4zyno.mirror.aliyuncs.com"
]
-- 编译docker镜像
docker build -t monitor/centos .
-- 导出docker镜像
docker save monitor/centos > monitor.tar
-- 导入docker镜像
docker load --input monitor.tar
-- 运行docekr镜像
docker run -p 8088:8088 -d monitor/centos:latest

1
run.sh Normal file
View File

@@ -0,0 +1 @@
java -jar /home/monitor-3.1.5.jar > nohup.log

View File

@@ -1,4 +1,4 @@
server.port=8080 server.port=8088
spring.thymeleaf.cache=true spring.thymeleaf.cache=true
@@ -6,9 +6,9 @@ spring.thymeleaf.cache=true
swagger.enable=false swagger.enable=false
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/quinn?useUnicode=true&characterEncoding=utf8&useSSL=false spring.datasource.url=jdbc:mysql://localhost:3306/smallapp_point?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=123456 spring.datasource.password=hyty1234
# mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl # mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus.mapper-locations=classpath*:com/quinn/mapper/xml/*.xml mybatis-plus.mapper-locations=classpath*:com/quinn/mapper/xml/*.xml