kulti / task-list

MIT License
9 stars 3 forks source link

use docker healthcheck to be sure that service already started #82

Closed kulti closed 4 years ago

kulti commented 4 years ago

Use https://docs.docker.com/engine/reference/builder/#healthcheck for the following services:

kulti commented 4 years ago

Docker healthcheck is not supported by docker-compose v3.

I try to experiment with docker-compose v2.4, which supports healthcheck. But without any success.

Also, healthcheck is not a good way to fix the problem because of the following scenario:

  1. The container with DB is up and healthy.
  2. The Container with the app begins to start.
  3. The container with DB gets down before app connects to it.

So, it's a good idea to develop applications with tolerance to unavailable resources.