I've a docker-compose file configuring a service with the restart policy set to always
The command is python3 script.py
And script.py just prints the current timestamp :
import time
print(time.time())
Using docker-compose up I get this :
random_service | 1546974860.1233172
random_service | 1546974861.9269428
random_service | 1546974863.616101
random_service | 1546974865.4225447
random_service | 1546974867.2077854
random_service | 1546974869.4796813
random_service | 1546974873.4290836
random_service | 1546974880.5541086
random_service | 1546974894.0697372
random_service | 1546974920.4050376
As you can see, it looks like the more docker tries to restart the service, the more it waits between restarts. At the beginning it tries every one or two seconds, then four, seven, fourteen, twenty-six...
How can I disable that ? I want my service to be restarted as soon as possible, every time it stops.