diff --git a/docker-compose.yaml b/docker-compose.yaml index 9abd164b..4fd00829 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 cce57bd1..8d2f98bf 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