diff --git a/.github/workflows/docker-build-ci.yml b/.github/workflows/docker-build-ci.yml index 2d88b72e7a..8d31ff266f 100644 --- a/.github/workflows/docker-build-ci.yml +++ b/.github/workflows/docker-build-ci.yml @@ -45,4 +45,8 @@ jobs: - name: Build ${{ matrix.dockerfile }} run: | - docker build -f ${{ matrix.dockerfile }} . + IMAGE_ID=$(docker build -q -f ${{ matrix.dockerfile }} .) + echo "Built: $IMAGE_ID" + HC=$(docker inspect --format='{{json .Config.Healthcheck}}' "$IMAGE_ID") + echo "Healthcheck: $HC" + [[ "$HC" != "null" ]] || { echo "ERROR: HEALTHCHECK missing in ${{ matrix.dockerfile }}"; exit 1; } diff --git a/hugegraph-pd/Dockerfile b/hugegraph-pd/Dockerfile index 41cac1adb6..15d19c6f76 100644 --- a/hugegraph-pd/Dockerfile +++ b/hugegraph-pd/Dockerfile @@ -52,7 +52,6 @@ RUN apt-get -q update \ curl \ lsof \ vim \ - cron \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -63,5 +62,8 @@ RUN chmod 755 ./docker-entrypoint.sh EXPOSE 8620 VOLUME /hugegraph-pd +HEALTHCHECK --interval=15s --timeout=10s --start-period=90s --retries=3 \ + CMD curl -fsS http://localhost:8620/v1/health >/dev/null + ENTRYPOINT ["/usr/bin/dumb-init", "--"] CMD ["./docker-entrypoint.sh"] diff --git a/hugegraph-server/Dockerfile b/hugegraph-server/Dockerfile index 4b06bdad6c..068719318f 100644 --- a/hugegraph-server/Dockerfile +++ b/hugegraph-server/Dockerfile @@ -53,7 +53,6 @@ RUN apt-get -q update \ curl \ lsof \ vim \ - cron \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties @@ -67,5 +66,8 @@ RUN chmod 755 ./docker-entrypoint.sh EXPOSE 8080 VOLUME /hugegraph-server +HEALTHCHECK --interval=15s --timeout=10s --start-period=90s --retries=3 \ + CMD curl -fsS http://localhost:8080/versions >/dev/null + ENTRYPOINT ["/usr/bin/dumb-init", "--"] CMD ["./docker-entrypoint.sh"] diff --git a/hugegraph-server/Dockerfile-hstore b/hugegraph-server/Dockerfile-hstore index 54494dbad2..6d3b82b5dc 100644 --- a/hugegraph-server/Dockerfile-hstore +++ b/hugegraph-server/Dockerfile-hstore @@ -55,7 +55,6 @@ RUN apt-get -q update \ curl \ lsof \ vim \ - cron \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties @@ -69,5 +68,8 @@ RUN chmod 755 ./docker-entrypoint.sh EXPOSE 8080 VOLUME /hugegraph-server +HEALTHCHECK --interval=15s --timeout=10s --start-period=90s --retries=3 \ + CMD curl -fsS http://localhost:8080/versions >/dev/null + ENTRYPOINT ["/usr/bin/dumb-init", "--"] CMD ["./docker-entrypoint.sh"] diff --git a/hugegraph-store/Dockerfile b/hugegraph-store/Dockerfile index 5883f9cbf7..43daa48e94 100644 --- a/hugegraph-store/Dockerfile +++ b/hugegraph-store/Dockerfile @@ -52,7 +52,6 @@ RUN apt-get -q update \ curl \ lsof \ vim \ - cron \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -63,5 +62,8 @@ RUN chmod 755 ./docker-entrypoint.sh EXPOSE 8520 VOLUME /hugegraph-store +HEALTHCHECK --interval=15s --timeout=10s --start-period=90s --retries=3 \ + CMD curl -fsS http://localhost:8520/v1/health >/dev/null + ENTRYPOINT ["/usr/bin/dumb-init", "--"] CMD ["./docker-entrypoint.sh"]