jshimko / meteor-launchpad

A base Docker image for Meteor applications.
https://hub.docker.com/r/jshimko/meteor-launchpad/
MIT License
276 stars 152 forks source link

Time delay vs wait-for-it for startup order #101

Open MrWinstead opened 6 years ago

MrWinstead commented 6 years ago

Current Behavior

In the docker documentation for controlling startup order, they recommend using (among others) wait-for-it. Currently the only available method for controlling startup order is a time-based timeout

Expected Behavior

Optionally support using network-based startup order control using wait-for-it

jshimko commented 6 years ago

Not a bad idea. I'll take a closer look.

I assume you know this, but in the meantime, you can also use the STARTUP_DELAY environment variable to set the number of seconds to wait on container startup. Or you can use a Docker Compose file and set the depends_on key to make sure the app container waits for the database container to start.

Obviously, neither of those options are better than something that checks actual connectivity, so perhaps wait-for-it would be a nice simple solution to add. I'll check it out.

Contributions are always welcome too!

MrWinstead commented 6 years ago

Sounds good. I'm closing in on completing this myself. I'll submit a PR soonest