Dockerfile

master
Yueng 2024-07-27 13:46:46 +08:00
parent 4951b15934
commit d136ce5150
3 changed files with 60 additions and 1 deletions

23
Dockerfile 100644
View File

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

12
aa 100644
View File

@ -0,0 +1,12 @@
location / {
root /home/web;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /prod-api/ {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8080/;
}

26
pom.xml
View File

@ -14,7 +14,11 @@
<description> <description>
cloud-modules-system系统模块 cloud-modules-system系统模块
</description> </description>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<!-- SpringCloud Alibaba Nacos --> <!-- SpringCloud Alibaba Nacos -->
@ -92,6 +96,26 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<!-- //加入maven deploy插件 当在deploy时忽略些model->-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<!-- <version></version>-->
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>