Skip to content

Commit

Permalink
chore: app now waits till MySQL is up and runnning
Browse files Browse the repository at this point in the history
Correction for 206d310 commit.

Part of #13
  • Loading branch information
php-coder committed Mar 21, 2024
1 parent 9480574 commit 097a708
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ services:
- '3306:3306'
volumes:
- ./categories.mysql.sql:/docker-entrypoint-initdb.d/categories.sql
healthcheck:
# Specifying "MYSQL_PWD" variable suppresses "Warning: Using a password on the command line interface can be insecure"
# Attention: MYSQL_PWD is deprecated as of MySQL 8.0; expect it to be removed in a future version of MySQL
# Note: double dollar sign protects variables from docker compose interpolation
test: "MYSQL_PWD=$$MYSQL_PASSWORD mysql --user=$$MYSQL_USER --silent --execute 'SELECT \"OK\" AS result'"
interval: 1s
timeout: 5s
retries: 10
start_period: 1s


express-js:
Expand All @@ -32,4 +41,5 @@ services:
ports:
- '3010:3010'
depends_on:
- mysql
mysql:
condition: service_healthy

0 comments on commit 097a708

Please sign in to comment.