From 51078eba12c7eb700a00f066085acd24d846480d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Tue, 31 Oct 2023 14:51:34 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20=E6=96=87=E6=A1=A3=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yaml | 10 ++++++++++ readme.md | 18 ++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 9abd164..4fd0082 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -10,11 +10,19 @@ services: ports: - "8080:8080" - "19088:19088" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:19088/api/checkLogin"] + interval: 60s + timeout: 10s + retries: 5 + mysql: image: mysql:8 container_name: gw-db restart: unless-stopped + depends_on: + - wechat environment: - MYSQL_ROOT_PASSWORD=wechat - MYSQL_USER=wechat @@ -28,6 +36,8 @@ services: image: gitee.ltd/lxh/go-wxhelper:latest container_name: gw-service restart: unless-stopped + depends_on: + - mysql volumes: # 配置文件请参阅项目根目录的config.yaml文件 - ./config/config.yaml:/app/config.yaml diff --git a/readme.md b/readme.md index cce57bd..8d2f98b 100644 --- a/readme.md +++ b/readme.md @@ -57,11 +57,19 @@ services: ports: - "8080:8080" - "19088:19088" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:19088/api/checkLogin"] + interval: 60s + timeout: 10s + retries: 5 + mysql: image: mysql:8 container_name: gw-db restart: unless-stopped + depends_on: + - wechat environment: - MYSQL_ROOT_PASSWORD=wechat - MYSQL_USER=wechat @@ -75,18 +83,24 @@ services: image: gitee.ltd/lxh/go-wxhelper:latest container_name: gw-service restart: unless-stopped + depends_on: + - mysql volumes: # 配置文件请参阅项目根目录的config.yaml文件 - ./config/config.yaml:/app/config.yaml ports: - "19099:19099" - ``` -3. 启动 +3. 启动 +`这玩意儿有点儿不完善,先启动wechat,确定启动起来了再启动剩余的` ```shell # 以下命令选个能用的就行 docker-compose up -d # 老版本 docker compose up -d # 新版本 + +# 分顺序启动 +docker compose up -d wechat # 1. 启动微信 +docker compose up -d # 启动剩余的 ``` \ No newline at end of file