docker-compose restart policy - disable exponential delay between restarts
You have options to customize your restart policy on the docker-compose level - https://docs.docker.com/engine/reference/commandline/service_create/:
--restart-condition Restart when condition is met (“none”|”on-failure”|”any”) (default “any”)
--restart-delay Delay between restart attempts (ns|us|ms|s|m|h) (default 5s)
--restart-max-attempts Maximum number of restarts before giving up
--restart-window Window used to evaluate the restart policy (ns|us|ms|s|m|h)
Mentioned restart behaviour is documented in https://docs.docker.com/engine/reference/run/#restart-policies---restart:
An ever increasing delay (double the previous delay, starting at 100 milliseconds) is added before each restart to prevent flooding the server. This means the daemon will wait for 100 ms, then 200 ms, 400, 800, 1600, and so on until either the on-failure limit is hit, or when you docker stop or docker rm -f the container.
If a container is successfully restarted (the container is started and runs for at least 10 seconds), the delay is reset to its default value of 100 ms.
You have still option to use another process manager in the container or in the host OS, which may fit your needs (upstart, systemd, supervisor, monit, ...). Some recommendations: https://docs.docker.com/config/containers/start-containers-automatically/#use-a-process-manager