File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,15 @@ services:
19
19
- '3306:3306'
20
20
volumes:
21
21
- ./categories.mysql.sql:/docker-entrypoint-initdb.d/categories.sql
22
+ healthcheck:
23
+ # Specifying "MYSQL_PWD" variable suppresses "Warning: Using a password on the command line interface can be insecure"
24
+ # Attention: MYSQL_PWD is deprecated as of MySQL 8.0; expect it to be removed in a future version of MySQL
25
+ # Note: double dollar sign protects variables from docker compose interpolation
26
+ test: "MYSQL_PWD=$$MYSQL_PASSWORD mysql --user=$$MYSQL_USER --silent --execute 'SELECT \"OK\" AS result'"
27
+ interval: 1s
28
+ timeout: 5s
29
+ retries: 10
30
+ start_period: 1s
22
31
23
32
24
33
express-js:
@@ -32,4 +41,5 @@ services:
32
41
ports:
33
42
- '3010:3010'
34
43
depends_on:
35
- - mysql
44
+ mysql:
45
+ condition: service_healthy
You can’t perform that action at this time.
0 commit comments