Files
peko-java/accompany-business/accompany-business-web/Dockerfile
2024-12-19 13:31:25 +08:00

31 lines
1.1 KiB
Docker

FROM 124.156.164.187:8089/openjdk/openjdk_8_chwl:1.0
VOLUME /data/java/weblog/accompany-business
USER root
ENV work_path /app
ENV app_jar accompany-business-web-1.0.0-exec.jar
ENV app_log /data/java/weblog/accompany-business
ENV MALLOC_ARENA_MAX 4
ARG profiles_active
ENV profiles_active $profiles_active
ENV service_port 8181
ENV mem_opts_env -server -Xms1024m -Xmx1024m -Xmn512m -Xss1024k -XX:SurvivorRatio=8
ENV gc_opts_env -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -verbose:gc -XX:+PrintGCDetails -XX:+DisableExplicitGC -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDetails -Xloggc:$app_log/logs/gc.log -XX:HeapDumpPath=$app_log/logs -XX:ErrorFile=$app_log/logs/java_error_%p.log
ENV other_opts_env -Dspring.profiles.active=$profiles_active -Duser.timezone=GMT+08 -Dserver.port=$service_port -Dfile.encoding=UTF-8
RUN mkdir -p $app_log/logs
COPY ./target/$app_jar $work_path/
EXPOSE $service_port
WORKDIR $work_path/
ENTRYPOINT java -jar $other_opts_env $mem_opts_env $gc_opts_env ./$app_jar $0 $@
HEALTHCHECK --interval=20s --timeout=10s --retries=10 CMD wget --quiet --tries=1 --spider http://localhost:$service_port/healthCheck || exit 1