添加dockerFile文件 + 打包jar包

master
sikadi 2023-12-01 11:19:00 +08:00
parent afcaaaed10
commit 9c931b6646
2 changed files with 36 additions and 1 deletions

20
Dockerfile 100644
View File

@ -0,0 +1,20 @@
FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/openjdk:17-8.6
# 暴露端口号
EXPOSE 9999/tcp
# 挂载目录位置
VOLUME /home/logs/fate-launch
#构造 复制外部文件到docker 内部
COPY fate-launch-server/target/fate-launch-server.jar /home/app.jar
# 工作目录 exec -it 进来就是默认这个目录1gitn1
WORKDIR /home
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > .etc.timezone
# 启动java程序
CMD ["java","-Dfile.encoding=UTF-8","-jar","/home/app.jar"]

View File

@ -63,5 +63,20 @@
<version>8.0.33</version>
</dependency>
</dependencies>
<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>
</plugins>
</build>
</project>