Skip to content

Commit 5361696

Browse files
better mysql healthcheck (#2459)
* better mysql healthcheck Signed-off-by: Ramon Petgrave <[email protected]> * increase retries, lower interval Signed-off-by: Ramon Petgrave <[email protected]> --------- Signed-off-by: Ramon Petgrave <[email protected]>
1 parent 1f43fb5 commit 5361696

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docker-compose.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ services:
2424
- MYSQL_PASSWORD=zaphod
2525
restart: always # keep the MySQL server running
2626
healthcheck:
27-
test: ["CMD", "/etc/init.d/mysql", "status"]
28-
interval: 30s
27+
# better healthcheck for mysql. See https://github.com/docker-library/mysql/issues/930.
28+
test: ["CMD", "mysqladmin", "-h", "localhost", "-u$MYSQL_USER", "-p$MYSQL_ROOT_PASSWORD", "-s", "ping"]
29+
interval: 10s
2930
timeout: 3s
30-
retries: 5
31+
retries: 15
3132
start_period: 90s
3233
redis-server:
3334
image: docker.io/redis:6.2

0 commit comments

Comments
 (0)