把-server项目改为jar包,新增 server-app项目作为启动器 http://172.16.46.63:31560/index.php?m=task&f=view&taskID=699

This commit is contained in:
ranke
2026-01-12 18:36:39 +08:00
parent 041a89bb59
commit 6644710fe0
42 changed files with 257 additions and 108 deletions

View File

@@ -1,19 +0,0 @@
## AdoptOpenJDK 停止发布 OpenJDK 二进制,而 Eclipse Temurin 是它的延伸,提供更好的稳定性
FROM 172.16.46.66:10043/base-service/eclipse-temurin:21-jre
## 创建目录,并使用它作为工作目录
RUN mkdir -p /zt-module-template-server
WORKDIR /zt-module-template-server
## 将后端项目的 Jar 文件,复制到镜像中
COPY ./target/zt-module-template-server.jar app.jar
## 设置 TZ 时区
## 设置 JAVA_OPTS 环境变量,可通过 docker run -e "JAVA_OPTS=" 进行覆盖
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms512m -Xmx1024m"
## 暴露后端项目的 48080 端口
EXPOSE 48100
## 启动后端项目
CMD java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar app.jar

View File

@@ -134,23 +134,4 @@
</dependency>
</dependencies>
<build>
<!-- 设置构建的 jar 包名 -->
<finalName>${project.artifactId}</finalName>
<plugins>
<!-- 打包 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,20 +0,0 @@
package com.zt.plat.module.template;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 项目的启动类
*
* @author 周迪
*/
@SpringBootApplication
@EnableScheduling
public class TemplateServerApplication {
public static void main(String[] args) {
SpringApplication.run(TemplateServerApplication.class, args);
}
}