How can I make Docker Compose wait until MySQL is ready?

0
1
Asked By VelvetComet42 On

I'm following a Docker getting-started workshop and ran into a startup race while using Docker Compose. The application container starts before MySQL has finished initializing, so it repeatedly waits for mysql:3306 and eventually fails with an ECONNREFUSED error. If I run docker compose down and then bring everything back up, it works because the database has already been initialized. Is this expected, and what is the recommended way to ensure the application only starts connecting after MySQL is ready?

0 Answers

There is no answer to this question yet. If you know the answer or can offer some help, please use the form below.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.