1.Dockerfile

2.忽略依赖
master
微醺 2024-08-13 15:27:48 +08:00
parent cfd5174c99
commit 5d793b51a8
2 changed files with 37 additions and 9 deletions

28
Dockerfile 100644
View File

@ -0,0 +1,28 @@
# |- home (必然存在的目录)
# |- app.jar --启动 jar 包
# |- logs--日志文件
# |- uploadPath --上传路径
# 指定构建镜像的起始镜像
FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/dragonwell:17.0.4.0.4.8-standard-ga-8.6
# 执行一些必备条件
#定义时区参数
ENV TZ=Asia/Shanghai
#设置时区
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
# 挂载 工作目录
VOLUME ["/home/logs/cloud-file","/home/uploadPath"]
# 拷贝,执行 jar 包
COPY ./target/cloud-modules-file.jar /home/app.jar
# 构建启动命令
ENTRYPOINT ["java","-jar"]
CMD ["/home/app.jar"]

18
pom.xml
View File

@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.muyu</groupId>
<artifactId>cloud-modules</artifactId>
<artifactId>cloud-server-parent</artifactId>
<version>3.6.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -76,14 +76,14 @@
</execution>
</executions>
</plugin>
<!-- 加入maven deploy插件当在deploy时忽略些model-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!-- &lt;!&ndash; 加入maven deploy插件当在deploy时忽略些model&ndash;&gt;-->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-deploy-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skip>true</skip>-->
<!-- </configuration>-->
<!-- </plugin>-->
</plugins>
</build>