From f6e0ae6f1dd14262819f90aeb1fbee025e8987bf Mon Sep 17 00:00:00 2001 From: BugKing Date: Mon, 27 Feb 2023 15:32:16 +0800 Subject: [PATCH] docs: add healthcheck for halo in compose (#189) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 Docker Compose 文件中,使用 `/actuator/health/readiness` 接口为 Halo 服务增加健康检查。 ```release-note docs: add healthcheck for halo in compose ``` --- docs/getting-started/install/docker-compose.md | 18 ++++++++++++++++++ .../getting-started/install/docker-compose.md | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/docs/getting-started/install/docker-compose.md b/docs/getting-started/install/docker-compose.md index 8521d7b..dacda8a 100644 --- a/docs/getting-started/install/docker-compose.md +++ b/docs/getting-started/install/docker-compose.md @@ -66,6 +66,12 @@ import DockerArgs from "./slots/docker-args.md" - ./:/root/.halo2 ports: - "8090:8090" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8090/actuator/health/readiness"] + interval: 30s + timeout: 5s + retries: 5 + start_period: 30s command: - --spring.r2dbc.url=r2dbc:pool:postgresql://halodb/halo - --spring.r2dbc.username=halo @@ -122,6 +128,12 @@ import DockerArgs from "./slots/docker-args.md" - ./:/root/.halo2 ports: - "8090:8090" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8090/actuator/health/readiness"] + interval: 30s + timeout: 5s + retries: 5 + start_period: 30s command: - --spring.r2dbc.url=r2dbc:pool:mysql://halodb:3306/halo - --spring.r2dbc.username=root @@ -179,6 +191,12 @@ import DockerArgs from "./slots/docker-args.md" - ./:/root/.halo2 ports: - "8090:8090" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8090/actuator/health/readiness"] + interval: 30s + timeout: 5s + retries: 5 + start_period: 30s command: # 外部访问地址,请根据实际需要修改 - --halo.external-url=http://localhost:8090/ diff --git a/versioned_docs/version-2.2/getting-started/install/docker-compose.md b/versioned_docs/version-2.2/getting-started/install/docker-compose.md index b0417ab..2c9fd14 100644 --- a/versioned_docs/version-2.2/getting-started/install/docker-compose.md +++ b/versioned_docs/version-2.2/getting-started/install/docker-compose.md @@ -66,6 +66,12 @@ import DockerArgs from "./slots/docker-args.md" - ./:/root/.halo2 ports: - "8090:8090" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8090/actuator/health/readiness"] + interval: 30s + timeout: 5s + retries: 5 + start_period: 30s command: - --spring.r2dbc.url=r2dbc:pool:postgresql://halodb/halo - --spring.r2dbc.username=halo @@ -122,6 +128,12 @@ import DockerArgs from "./slots/docker-args.md" - ./:/root/.halo2 ports: - "8090:8090" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8090/actuator/health/readiness"] + interval: 30s + timeout: 5s + retries: 5 + start_period: 30s command: - --spring.r2dbc.url=r2dbc:pool:mysql://halodb:3306/halo - --spring.r2dbc.username=root @@ -179,6 +191,12 @@ import DockerArgs from "./slots/docker-args.md" - ./:/root/.halo2 ports: - "8090:8090" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8090/actuator/health/readiness"] + interval: 30s + timeout: 5s + retries: 5 + start_period: 30s command: # 外部访问地址,请根据实际需要修改 - --halo.external-url=http://localhost:8090/