28 lines
682 B
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.

# 使用官方Eclipse Temurin镜像作为基础镜像JDK17兼容Spring Boot 3.x
FROM eclipse-temurin:17-jdk-jammy
# 设置工作目录
WORKDIR /app
# 创建日志目录
RUN mkdir -p /app/logs && chmod 755 /app/logs
VOLUME /opt/docker-images
ADD ebike-report-0.0.1-SNAPSHOT.jar /app/ebike-report.jar
# 设置JVM参数根据实际需求调整
ENV JAVA_OPTS="-Xms512m -Xmx1024m"
# 暴露应用端口与application.yml配置一致
EXPOSE 10015
# 健康检查配置
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost:10015/actuator/health || exit 1
# 容器启动命令
ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar ebike-report.jar"]