How can I organize healthcheck for my workers (Docker with python code)?

In my project I have a REST API (Flask-server) and workers (python script that work in Docker containers – simple infinite cycle, make request to server and get work). Flask-server send tasks to workers.

But of course something might go wrong and Docker container may fall. And at that moment I want server to know about it. Can you offer a simple way to do that?

Source: Docker Questions