0%
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| FROM exxk/java:8-alpine-cst
EXPOSE 9303
ARG JAVA_OPTS="-Xms256m -Xmx256m -XX:NewRatio=1"
COPY target/*.jar app.jar COPY src/main/resources/bootstrap.properties config/bootstrap.properties
HEALTHCHECK --start-period=40s --interval=30s --timeout=5s --retries=5 CMD (wget http://localhost:9303/actuator/health -q -O -) | grep UP || exit 1
ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar /app.jar"]
|
1 2 3 4 5 6 7 8 9
| HEALTHCHECK --start-period=40s --interval=30s --timeout=5s --retries=5 CMD (wget http://localhost:9303/actuator/health -q -O -) | grep UP || exit 1 HEALTHCHECK [OPTIONS] CMD command 通过运行容器内的一个指令来检查容器的健康情况 --interval=DURATION 间隔时间, 默认 30s (30秒); --timeout=DURATION 超时时间, 默认 30s (30秒);
--start-period=DURATION 启动时间, 默认 0s, 如果指定这个参数, 则必须大于 0s ; --retries=N 重试次数, 默认 3 ;
(wget http://localhost:9303/actuator/health -q -O -) | grep UP || exit 1
|