Files
JChargePointProtocol/docker/app.Dockerfile
三丙 58580ca11e !45 !44 comment
* !44 comment
* !39 添加下行日志打印
* !36 扩展计价领域模型
* !35 webui 初步成型
* !34 webui 初步成型
2025-09-09 08:23:59 +00:00

47 lines
1.4 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#
# 开源代码,仅供学习和交流研究使用,商用请联系三丙
# 微信mohan_88888
# 抖音:程序员三丙
# 付费课程知识星球https://t.zsxq.com/aKtXo
#
FROM registry.cn-hangzhou.aliyuncs.com/sanbing/jcpp-base:1.0 AS base
WORKDIR /app
COPY . .
RUN mvn -U -B -T 4 clean package -DskipTests
#分层
FROM registry.cn-hangzhou.aliyuncs.com/sanbing/openjdk:21-bullseye AS builder
WORKDIR /app
COPY --from=base /app/jcpp-app-bootstrap/target/application.jar application.jar
RUN java -Djarmode=tools -jar application.jar extract --layers --destination extracted
# 执行
FROM registry.cn-hangzhou.aliyuncs.com/sanbing/openjdk:21-bullseye
RUN useradd -m sanbing
WORKDIR /home/sanbing
COPY --from=builder /app/extracted/dependencies/ ./
COPY --from=builder /app/extracted/spring-boot-loader/ ./
COPY --from=builder /app/extracted/snapshot-dependencies/ ./
COPY --from=builder /app/extracted/application/ ./
COPY --from=base /app/jcpp-app-bootstrap/target/conf ./config
COPY --from=base /app/docker/start.sh .
RUN chmod a+x start.sh \
&& mkdir -p /home/sanbing/logs/jcpp \
&& mkdir -p /home/sanbing/logs/accesslog \
&& mkdir -p /home/sanbing/logs/gc \
&& mkdir -p /home/sanbing/logs/heapdump \
&& chmod 700 -R /home/sanbing/logs/* \
&& chown -R sanbing:sanbing /home/sanbing
EXPOSE 8080/tcp 38001/tcp 38002/tcp 38003/tcp 38011/tcp
ENV APP_LOG_LEVEL=INFO
ENV PROTOCOLS_LOG_LEVEL=INFO
USER sanbing
CMD ["/bin/bash", "start.sh"]