Skip to content

Commit

Permalink
docker: add sleep in mysql healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Oct 30, 2024
1 parent a585c28 commit a62032e
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 112 deletions.
176 changes: 66 additions & 110 deletions generators/docker-compose/__snapshots__/docker-compose.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
mscouchbase:
Expand Down Expand Up @@ -317,12 +315,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
mscassandra:
Expand Down Expand Up @@ -572,12 +568,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
msmysql:
Expand Down Expand Up @@ -612,12 +606,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
mspsql:
Expand Down Expand Up @@ -956,12 +948,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
msmysql:
Expand Down Expand Up @@ -1001,12 +991,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
mspsql:
Expand Down Expand Up @@ -1384,12 +1372,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
msmysql:
Expand Down Expand Up @@ -1424,12 +1410,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
mspsql:
Expand Down Expand Up @@ -1719,12 +1703,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
msmysql:
Expand Down Expand Up @@ -1759,12 +1741,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
mspsql:
Expand Down Expand Up @@ -2045,12 +2025,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
msmysql:
Expand Down Expand Up @@ -2085,12 +2063,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
consul:
Expand Down Expand Up @@ -2237,12 +2213,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
msmysql:
Expand Down Expand Up @@ -2277,12 +2251,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
consul:
Expand Down Expand Up @@ -2454,12 +2426,10 @@ management:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
msmysql:
Expand Down Expand Up @@ -2494,12 +2464,10 @@ management:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
consul:
Expand Down Expand Up @@ -2735,12 +2703,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
msmysql:
Expand Down Expand Up @@ -2775,12 +2741,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
consul:
Expand Down Expand Up @@ -2894,12 +2858,10 @@ Launch all your infrastructure by running: \`docker compose up -d\`.
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
samplemysql-elasticsearch:
image: elasticsearch-placeholder
Expand Down Expand Up @@ -3026,12 +2988,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
consul:
Expand Down Expand Up @@ -3160,12 +3120,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
consul:
Expand Down Expand Up @@ -3292,12 +3250,10 @@ jhipster:
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test:
- CMD
- mysql
- -e
- SHOW DATABASES;
- CMD-SHELL
- mysql -e "SHOW DATABASES;" && sleep 5
interval: 5s
timeout: 5s
timeout: 10s
retries: 10
consul:
Expand Down
4 changes: 2 additions & 2 deletions generators/docker/templates/docker/mysql.yml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
- 127.0.0.1:3306:3306
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
healthcheck:
test: ["CMD", "mysql", "-e", "SHOW DATABASES;"]
test: ['CMD-SHELL', 'mysql -e "SHOW DATABASES;" && sleep 5']
interval: 5s
timeout: 5s
timeout: 10s
retries: 10

0 comments on commit a62032e

Please sign in to comment.