Toggle navigation
Toggle navigation
This project
Loading...
Sign in
crp
/
crp-operation
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhongdaoyi@wondertek.com.cn
2025-07-24 15:06:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8c0f6cd4337597b2edd7b9a9f9b5f7112544b60f
8c0f6cd4
1 parent
84b415e8
打包配置
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
0 deletions
Dockerfile
docker/Dockerfile
pom.xml
Dockerfile
0 → 100644
View file @
8c0f6cd
FROM openjdk:17-jdk-alpine
# 保持系统更新并安装必要的构建工具
RUN apk update && apk add --no-cache bash build-base
# 安装MediaInfo工具
RUN apk --no-cache add mediainfo
###以下为修改项每个业务有差异###
ADD target/crp-operation-1.0.0.jar /opt/
###设置时区###
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
### JAVA参数调优
### ENV JAVA_OPTS='-Xms216m -Xmx512m'
## 启动命令
CMD java -jar /opt/crp-operation-1.0.0.jar --spring.profiles.active=${SPRING_PROFILE_ACTIVE}
...
...
docker/Dockerfile
0 → 100644
View file @
8c0f6cd
FROM 192.168.1.7/library/java17:centos7
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
SPRING_PROFILE_ACTIVE=preview \
SPRING_OPTS="" \
JAVA_OPTS=""
CMD java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /app.jar --spring.profiles.active=${SPRING_PROFILE_ACTIVE} ${SPRING_OPTS}
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
ADD target/*.jar /app.jar
\ No newline at end of file
...
...
pom.xml
View file @
8c0f6cd
...
...
@@ -189,6 +189,60 @@
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>
com.spotify
</groupId>
<artifactId>
docker-maven-plugin
</artifactId>
<version>
1.2.2
</version>
<executions>
<execution>
<id>
build-image
</id>
<phase>
package
</phase>
<goals>
<goal>
build
</goal>
<goal>
push
</goal>
</goals>
</execution>
</executions>
<configuration>
<imageName>
192.168.1.69/ai_lib/${project.artifactId}:${project.version}
</imageName>
<dockerHost>
http://192.168.1.70:2375
</dockerHost>
<dockerDirectory>
${basedir}/docker
</dockerDirectory>
<resources>
<resource>
<targetPath>
/
</targetPath>
<directory>
${project.build.directory}
</directory>
<include>
${project.build.finalName}.jar
</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>
docker
</id>
<properties>
<spring.profiles.active>
preview
</spring.profiles.active>
</properties>
<build>
<plugins>
<plugin>
<groupId>
com.spotify
</groupId>
<artifactId>
docker-maven-plugin
</artifactId>
<configuration>
<imageName>
192.168.1.7/ivod/${project.artifactId}:${project.version}
</imageName>
<dockerHost>
http://192.168.1.70:2375
</dockerHost>
<serverId>
wd-harbor
</serverId>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment