Skip to content

Commit 1ab2e92

Browse files
FinleyGeclaudehappy-otter
authored
feat: add health check to MongoDB service in Docker Compose templates (#5776)
* feat: add health check to MongoDB service in Docker Compose templates - Add health check configuration to MongoDB service in both dev and prod templates - Use mongo client ping command with authentication to verify service availability - Configure 10s interval, 5s timeout, 5 retries, and 30s start period - Ensures MongoDB service health monitoring consistent with other services Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <[email protected]> Co-Authored-By: Happy <[email protected]> * chore: regenerate Docker Compose files with MongoDB health check - Run pnpm gen:deploy to regenerate all Docker Compose files - MongoDB health checks are now included in all generated variants - Health check configuration: 10s interval, 5s timeout, 5 retries, 30s start period - Affects dev, prod and documentation Docker Compose files Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <[email protected]> Co-Authored-By: Happy <[email protected]> --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Happy <[email protected]>
1 parent 1984690 commit 1ab2e92

20 files changed

+120
-0
lines changed

deploy/dev/docker-compose.cn.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ services:
4848
- MONGO_INITDB_ROOT_PASSWORD=mypassword
4949
volumes:
5050
- ./mongo/data:/data/db
51+
healthcheck:
52+
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
53+
interval: 10s
54+
timeout: 5s
55+
retries: 5
56+
start_period: 30s
5157
entrypoint:
5258
- bash
5359
- -c

deploy/dev/docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ services:
4848
- MONGO_INITDB_ROOT_PASSWORD=mypassword
4949
volumes:
5050
- ./mongo/data:/data/db
51+
healthcheck:
52+
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
53+
interval: 10s
54+
timeout: 5s
55+
retries: 5
56+
start_period: 30s
5157
entrypoint:
5258
- bash
5359
- -c

deploy/docker/cn/docker-compose.milvus.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ services:
9999
- MONGO_INITDB_ROOT_PASSWORD=mypassword
100100
volumes:
101101
- ./mongo/data:/data/db
102+
healthcheck:
103+
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
104+
interval: 10s
105+
timeout: 5s
106+
retries: 5
107+
start_period: 30s
102108
entrypoint:
103109
- bash
104110
- -c

deploy/docker/cn/docker-compose.oceanbase.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ services:
7676
- MONGO_INITDB_ROOT_PASSWORD=mypassword
7777
volumes:
7878
- ./mongo/data:/data/db
79+
healthcheck:
80+
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
81+
interval: 10s
82+
timeout: 5s
83+
retries: 5
84+
start_period: 30s
7985
entrypoint:
8086
- bash
8187
- -c

deploy/docker/cn/docker-compose.pg.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ services:
5757
- MONGO_INITDB_ROOT_PASSWORD=mypassword
5858
volumes:
5959
- ./mongo/data:/data/db
60+
healthcheck:
61+
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
62+
interval: 10s
63+
timeout: 5s
64+
retries: 5
65+
start_period: 30s
6066
entrypoint:
6167
- bash
6268
- -c

deploy/docker/cn/docker-compose.zilliz.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ services:
4040
- MONGO_INITDB_ROOT_PASSWORD=mypassword
4141
volumes:
4242
- ./mongo/data:/data/db
43+
healthcheck:
44+
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
45+
interval: 10s
46+
timeout: 5s
47+
retries: 5
48+
start_period: 30s
4349
entrypoint:
4450
- bash
4551
- -c

deploy/docker/global/docker-compose.milvus.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ services:
9999
- MONGO_INITDB_ROOT_PASSWORD=mypassword
100100
volumes:
101101
- ./mongo/data:/data/db
102+
healthcheck:
103+
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
104+
interval: 10s
105+
timeout: 5s
106+
retries: 5
107+
start_period: 30s
102108
entrypoint:
103109
- bash
104110
- -c

deploy/docker/global/docker-compose.oceanbase.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ services:
7676
- MONGO_INITDB_ROOT_PASSWORD=mypassword
7777
volumes:
7878
- ./mongo/data:/data/db
79+
healthcheck:
80+
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
81+
interval: 10s
82+
timeout: 5s
83+
retries: 5
84+
start_period: 30s
7985
entrypoint:
8086
- bash
8187
- -c

deploy/docker/global/docker-compose.pg.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ services:
5757
- MONGO_INITDB_ROOT_PASSWORD=mypassword
5858
volumes:
5959
- ./mongo/data:/data/db
60+
healthcheck:
61+
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
62+
interval: 10s
63+
timeout: 5s
64+
retries: 5
65+
start_period: 30s
6066
entrypoint:
6167
- bash
6268
- -c

deploy/docker/global/docker-compose.ziliiz.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ services:
4040
- MONGO_INITDB_ROOT_PASSWORD=mypassword
4141
volumes:
4242
- ./mongo/data:/data/db
43+
healthcheck:
44+
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
45+
interval: 10s
46+
timeout: 5s
47+
retries: 5
48+
start_period: 30s
4349
entrypoint:
4450
- bash
4551
- -c

0 commit comments

Comments
 (0)