From 0cfaf8cd80b7b4f1feb681c12cc907c25ddd2192 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Sat, 29 Oct 2022 22:06:13 +0800 Subject: [PATCH] docs: update documentation for docker-compose (#104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /kind documentation 1. 移除 `/etc/timezone` 和 `/etc/localtime` 的挂载。 2. PostgreSQL 容器增加 `healthcheck`。 ```release-note None ``` --- docs/getting-started/install/docker-compose.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/getting-started/install/docker-compose.md b/docs/getting-started/install/docker-compose.md index 395c49a..aa706b2 100644 --- a/docs/getting-started/install/docker-compose.md +++ b/docs/getting-started/install/docker-compose.md @@ -38,7 +38,7 @@ description: 使用 Docker Compose 部署 1. 仅创建 Halo 实例(使用默认的 H2 数据库): - ```yaml {15-20} + ```yaml {13-20} version: "3" services: @@ -48,8 +48,6 @@ description: 使用 Docker Compose 部署 restart: on-failure:3 volumes: - ./:/root/halo-next - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro ports: - "8090:8090" environment: @@ -63,7 +61,7 @@ description: 使用 Docker Compose 部署 2. 创建 Halo + PostgreSQL 的实例: - ```yaml {19-29,43} + ```yaml {18-28,46} version: "3" services: @@ -72,13 +70,12 @@ description: 使用 Docker Compose 部署 container_name: halo_next restart: on-failure:3 depends_on: - - halo_db + halo_db: + condition: service_healthy networks: halo_network: volumes: - ./:/root/halo-next - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro ports: - "8090:8090" environment: @@ -101,10 +98,14 @@ description: 使用 Docker Compose 部署 networks: halo_network: volumes: - - /etc/localtime:/etc/localtime:ro - ./db:/var/lib/postgresql/data ports: - "5432:5432" + healthcheck: + test: [ "CMD", "pg_isready" ] + interval: 10s + timeout: 5s + retries: 5 environment: - POSTGRES_PASSWORD=openpostgresql - POSTGRES_USER=halo