master^2
冯凯 2023-12-05 09:33:50 +08:00
parent 429a07e2e3
commit 711b6dabee
4 changed files with 45 additions and 2 deletions

18
Dockerfile 100644
View File

@ -0,0 +1,18 @@
#起始镜像
FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/openjdk:17-8.6
#暴露端口号
EXPOSE 8068
#挂载目录的位置
VOLUME /home/logs/parseSystem
#构建复制外部文件到docker
COPY /target/parsesystem.jar /home/app.jar
#工作目录 exec -it 进入容器内部后的默认的起始目录
WORKDIR /home
ENV TIME_ZONE Asia/Shanghai
#指定东八区
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
#启动java 程序
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-jar","/home/app.jar"]

26
pom.xml
View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.parseSystem</groupId> <groupId>com.parseSystem</groupId>
<artifactId>parseSystem</artifactId> <artifactId>parsesystem</artifactId>
<version>3.6.3</version> <version>3.6.3</version>
<properties> <properties>
@ -97,4 +97,28 @@
</releases> </releases>
</repository> </repository>
</repositories> </repositories>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>16</source><target>16</target></configuration></plugin>
</plugins>
</build>
</project> </project>

View File

@ -22,6 +22,7 @@ public class FaultEvent extends EventHandlerService implements VehicleEventServ
*/ */
@Override @Override
public void executeEvent(VehicleData vehicleData) { public void executeEvent(VehicleData vehicleData) {
System.out.println("你好故障"); System.out.println("你好故障");
} }
} }

View File

@ -26,4 +26,4 @@ spring:
publisher-confirms: true #确认消息已发送到交换机(Exchange) publisher-confirms: true #确认消息已发送到交换机(Exchange)
publisher-returns: true #确认消息已发送到队列(Queue) publisher-returns: true #确认消息已发送到队列(Queue)
server: server:
port: 8066 port: 8068