title: docker-compose restart interval
body: <p>I have a <code>docker-compose.yml</code> file with a following:</p>
  
  <pre><code>services:
    kafka_listener:
      build: .
      command: bundle exec ./kafka foreground
      restart: always
    # other services
  </code></pre>
  
  <p>Then I start containers with: <code>docker-compose up -d</code></p>
  
  <p>On my amazon instance kafka-server (for example) fails to start sometimes, so <code>./kafka foregound</code> script fails. When typing <code>docker ps</code> I see a message: <code>Restarting (1) 11 minutes ago</code>. I thought docker should restart failed container instantly, but it seems it doesn't. After all, container has been restarted in about 30 minutes since first failed attempt.</p>
  
  <p>Is there any way to tell Docker-Compose to restart container instantly after failure?</p>