Here you can find a very basic example how to use docker swarm config and healthcheck feature.
docker build -t pyhello .
docker run -t -p 8000:8000 pyhello:latest
Open your browser at http://localhost:8000
You should see Hello world!
docker swarm init
docker stack deploy --compose-file compose/stack-compose.yaml pyhello
Open your browser at http://localhost:8000
You should see Hello Swarm Config!
sourced from the swarm config file.