This repository was archived by the owner on Aug 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (22 loc) · 1.48 KB
/
Copy pathDockerfile
File metadata and controls
26 lines (22 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# syntax = docker/dockerfile:1.3
FROM maven:3-jdk-8 AS build
WORKDIR /usr/src/app
COPY . .
RUN if [ -e **/src/main/**/logback-prod.xml ]; then mv -f $(ls **/src/main/**/logback-prod.xml) $(ls **/src/main/**/logback.xml); fi
RUN java -version &\
mvn -version
RUN --mount=type=cache,target=/.m2/repository \
mvn -Dmaven.repo.local=/.m2/repository clean -U package -s ./.m2/settings.xml -Dfile.encoding=UTF-8 -DskipTests=true
FROM fabric8/java-centos-openjdk8-jdk:1.8
USER root
ENV LANG en_US.UTF-8
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY --from=build /usr/src/app/target/*.jar /app.jar
ENV JAVA_APP_JAR=/app.jar
ENV JAVA_APP_DIR=/
ENV JAVA_OPTIONS="-server -Dserver.port=80 -Djava.security.egd=file:/dev/./urandom -Drocketmq.client.logUseSlf4j=true \
-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:MinRAMPercentage=70.0 -XX:NewRatio=2 -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:MaxDirectMemorySize=256m -XX:-OmitStackTraceInFastThrow -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -XX:+CMSScavengeBeforeRemark -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=65 -XX:+UseCMSInitiatingOccupancyOnly -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses \
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/heap/ddd-template.hprof -Xloggc:/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps"
VOLUME /heap
ENTRYPOINT ["sh", "/deployments/run-java.sh"]